Fixing bugs in program. Will re-upload any other questions in a separate post.

Last edited on

Have you considered using a Directed Acyclic Graph, then using a Shortest Path algorithm? That seems more suited to what you're doing, to me.

I have considering using that but given that the deadline for my project is approaching soon - I am not too sure if I will be able to complete it in a timely manner.

You mentioned Dijkstra's Algorithm. Well, coincidentally, that is a shortest path algorithm over a DAG.

In your example, the Airports are the nodes, the Flights are the paths and the Prices are the weights.

In your example, the Airports are the nodes, the Flights are the paths and the Prices are the weights.

Last edited on

I always get this stuff a little mixed up as I havent touched it since school days...

but Dijkstra's may be true shortest path (not touching every node once, just get from a to b). Do you need to visit every node once in a path? Can you visit a node more than once (this shouldnt be cheaper, but if the graph is unrealistic with the values, it can happen, eg a to b to c to b to d is cheaper than a to b to d etc).

but Dijkstra's may be true shortest path (not touching every node once, just get from a to b). Do you need to visit every node once in a path? Can you visit a node more than once (this shouldnt be cheaper, but if the graph is unrealistic with the values, it can happen, eg a to b to c to b to d is cheaper than a to b to d etc).

Thanks for the help kbw. I will try to redesigning the program using Dijkstra's Algorithm after fixing the bugs in the current iteration.

Hi jonnin, the node should ideally only visit the node once in a path.

Hi jonnin, the node should ideally only visit the node once in a path.

Topic archived. No new replies allowed.