Skip to content

The Graph's Functions

shaCode256 edited this page Dec 15, 2020 · 1 revision

This graph functions include:

  • save()- Saving the graph into a file
  • load()- Loading a graph from a file
  • shortestPath()- Find the lighted (the minimal weight of edges) path between two nodes using Dijkstra's algorithm, implemented by a queue
  • shortestPathDist()- Returning the shortest path's between two nodes weight
  • add(node_data node)- Adding nodes to a graph
  • remove(node_data node)- Removing nodes from a graph
  • AddEdge(node_data src, node_data dest)- #tochange- Adding neighbors to nodes in the graph- meaning creating an edge between two nodes, starting from the src node to the dest node
  • RemoveEdge(node_data src, node_data dest)- Removing neighbors to nodes in the graph- meaning creating an edge between two nodes, starting from the src node to the dest node
  • Receiving the neighbors of a particular junction
  • setInfo()- Adding information to the nodes themselves, in two information values ("variables") for each node
  • isConnected()- Checking the connectivity of the graph, is it a connected graph or not.
  • copy()- Deep copy of a graph

Also, there are some RICH TESTS for you to test almost everything in there. Got any additions/ comments? I would love to hear.

Clone this wiki locally