This project represents the structure of a directed weighted graph, and run algorithms on it
Represents the graph, and all the funcation it has- getNode, addNode, getEdge, connect (add new Edge), removeNode, removeEdge
Nodes- an HashMapcontains all the Nodes (with all the data anout him) in the graph.
Edges- an HashMap contains all the Edges (with all the data anout him) in the graph.
EdgesSize- the number of edges in the graph.
NodesSize- the number of vertices in the graph.
represent the nodes in the graph.
Each node have:
- key- id associated with this node.
- Geolocation- location of this node
- weight- he weight associated with this node
- tag and info
represent all the edges in the graph. Each edge have :
- Src- The id of the source node of this edge.
- Dest- The id of the destination node of this edge.
- weight- the weight associated with this edge
- tag and info
represent the location of (x,y,z), and distance between each teo of them.
This class resprents algoritems we can use on a Graph.
- isConnected- check if the graph is connected. We with DFS algoritem on the original grahp, and the transpose graph. --> if equals, the graph is connected.
- shortestPathDist- returns the shortest path between to nodes. We use dijkstra algoritem to find the shortestpath.
- shortestPath- return a list of nodes, that represent the shortest path between to given node
- center-
- tsp- This method get list of vertices and computes a relatively short path which visit each node in the targets List.just a simple path going over all nodes in the list.
- save- saves a graph to json file.
- load- loads a graph from json to DirectedWeightedGraph_ans object.