DGraph - shirabs/Ex_2 GitHub Wiki
DGraph is calass that represents the connetions between EdgeData to DataNode. DGraph Defined like this :
- private String type="DGraph";
- private HashMap<Integer,node_data> DataMap;
- private HashMap<Integer, HashMap<Integer, edge_data>> EdgeMap;
- private int countEdge=0;
- private int mc;
Empty Constructor.
get key and return node.
get start and end , return EdgeData.
public void addNode(node_data n)
method that add node.
This method get Src and Dest that represented by the key of the desired nodes and Weight of the edge and make a new edge in the graph.
This method bring the nodes collection of the graph.
This method get a key of node and bring the edges collection tha connect to this node.
This method get a key of node and delete the node and all the edges that connected it.
This method get Src and Dest that represented by the key of the desired nodes and delete the edge from the graph.
Return node size.
Return Edge size.
Return mc (number of changes on the graph).