Bridges-Java-2.3.2
2.3.2
Bridges(JavaAPI)
|
The GraphAdjMatrix class can be used to represent adjacency matrix based * graphs in BRIDGES. More...
Public Member Functions | |
GraphAdjMatrix (int size) | |
String | getDataStructType () |
void | addVertex (K k, E e) |
void | addEdge (K src, K dest, int weight) |
HashMap< K, Element< E > > | getVertices () |
HashMap< K, HashMap< K, Integer > > | getAdjacencyMatrix () |
Additional Inherited Members | |
![]() | |
abstract String | getDataStructType () |
![]() | |
String | QUOTE = "\"" |
The GraphAdjMatrix class can be used to represent adjacency matrix based * graphs in BRIDGES.
E represents a application data specific generic parameter, and K a key value (not used now) The class uses Java Hashmaps to implement a 2D array representation, near constant time access to the graph vertices and edges. BRIDGES provides methods to visualize the graph and its contents
bridges.base.GraphAdjMatrix< K, E >.GraphAdjMatrix | ( | int | size | ) |
Constructor
void bridges.base.GraphAdjMatrix< K, E >.addEdge | ( | K | src, |
K | dest, | ||
int | weight | ||
) |
Adds a new edge to the graph, adds it to that vertex's adjacency list; user is responsible for checking if the vertices already exist.
src | - source vertex of edge |
dest | - destination vertex of edge |
weight | - edge weight |
void bridges.base.GraphAdjMatrix< K, E >.addVertex | ( | K | k, |
E | e | ||
) |
Adds a new vertex to the graph, initializes the adjacency list; user is responsible for checking if the vertex already exists. This method will replace the value for this key
K | - vertex key value |
HashMap<K, HashMap<K, Integer> > bridges.base.GraphAdjMatrix< K, E >.getAdjacencyMatrix | ( | ) |
Gets the adjacency matrix
String bridges.base.GraphAdjMatrix< K, E >.getDataStructType | ( | ) |
This method gets the data structure type
HashMap<K, Element<E> > bridges.base.GraphAdjMatrix< K, E >.getVertices | ( | ) |
This method returns the graph nodes