Graph_Algo class - Orgamliel7/Ex3- GitHub Wiki
- Graph_Algo implements the interface graph_algorithms
- What is TSP?
The travelling salesman problem asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the origin city?"
- What is shortest path problem?
The problem of finding a path between two vertices (or nodes) in a graph such that the sum of the weights of its constituent edges is minimized. We've decided to use Dijkstra's algorithm to solve it.
- What is strongly connected problem?
A graph is said to be strongly connected or diconnected if every vertex is reachable from every other vertex.
For more information about our data stracture, you can click the links below:
-
init(graph g) - Init this set of algorithms on the parameter - graph.
-
graph copy() - Compute a deep copy of this graph.
-
init(String file_name) - The method saves the graph to a file.
-
save(String file_name) - he method saves the graph to a file.
-
isConnected() - Returns true if and only if there is a valid path from EVREY node to each other node.
-
shortestPathDist(int src, int dest) - returns the length of the shortest path between src to dest.
-
List<node_data> shortestPath(int src, int dest) - returns the the shortest path between src to dest - as an ordered List of nodes.
-
List<node_data> TSP(List targets) - computes a relatively short path which visit each node in the targets List.