Initialization & Functions example - achiyazigi/directional-weighted-graph-DS GitHub Wiki
directed_weighted_graph_DS g = new DWGraph_DS();
g.addNode(new NodeData(0));
if the key is already exists no action will be executed.
g.connect(0, 1, 2.4);
in case of non existed keys in the graph (1 or 2) no error will be prompted.
in case of same edge value no action will be executed.
in case of new edge value, an update will be performed.
edge_data val = g.getEdge(0, 1);
in case of non existed edge in the graph, null will be returned.
int e = g.edgeSize();
node_info n = g.getNode(0);
in case of non existed key in the graph, n <-null.
Collection<node_info> col = g.getV();
in case of empty graph, col will be empty (not null!!).
Collection<node_info> col = g.getE(<some_key>);
in case of non existed key in the graph, col will be null.
in case of not existed neighbors, col will be empty.
int mods = g.getMC();