How can I make Yen’s algorithm only find paths where no two nodes have the same ID?

I have clusters of nodes that correspond to one item. I want the algorithm to return only paths with unique IDs on each node.