I was looking at this.
If I were just given a list that contained the number of edges (graph), pair of edges, a origin and a destination, how would I figure out if there is or isn't a path?
I have some idea, but just need a bit of help in terms of starting in scheme.
(is_it_a_path? '(4 ((1 2) (2 3) (3 4) (2 4))) 1 4) ; returns true
(is_it_a_path? '(3 ((1 2) (2 3) (3 1))) 2 3) ; also returns true
In the following 4 is the number of vertices, (1 2)... and so are are the edges and 1 is the start and 4 is the end. Basically from these you are looking at whether there is a path from 1 to 4 in the following defined graph. I hope that can clarify what I mean.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…