In an undirected graph, given two points u and v, and there are no edges between u and v, find the number of simple paths that do not intersect between these two points?
菜鸟级高手: I have also considered breadth search, but there is no better way to solve the two constraints of "disjoint" and optimization? Can you say something specific?
Each time an element is traversed, a mark is added. It is no longer accessed before the mark is cleared, which can avoid "intersection"
What do you mean by optimization?
bigc: Is there a path through K-1 nodes between u and v: Google's questions can be calculated by matrix operations, and by the method of passing closure