DGraph class - Orgamliel7/Ex3- GitHub Wiki
- DGraph implements the interface graph
-
What is Weighted Graph? A Graph is called weighted graph when it has weighted edges which means there are some cost associated with each edge in graph.
-
What is directed Graph? A graph that is made up of a set of vertices connected by edges, where the edges have a direction associated with them.
For more information about our data stracture, you can click the links below:
-
getNode(int key) - return the data of the edge (src,dest), null if none.
-
getEdge(int src, int dest) - Add a new node to the graph with the given node_data.
-
addNode(node_data n) - The method connect an edge with weight w between node src to node dest.
-
connect(int src, int dest, double w) - returns a pointer (shallow copy) for the collection representing all the nodes in the graph.
-
Collection<node_data> getV() - returns a pointer (shallow copy) for the collection representing all the edges getting out of the given node (all the edges starting (source) at the given node).
-
Collection<edge_data> getE(int node_id) - Delete the node (with the given ID) from the graph & removes all edges which starts/ends at this node.
-
node_data removeNode(int key) - Delete the edge from the graph.
-
edge_data removeEdge(int src, int dest) - return the number of vertices (nodes) in the graph.
-
nodeSize() - return the number of edges (assume directional graph).
-
edgeSize() - return the Mode Count - for testing changes in the graph.
-
getMC() - ....
Our data stracture for the graph is