Bridges-Java
3.4.3
Bridges(Java API)
|
The GraphAdjMatrixSimple class is a simplification of the GraphAdjList class; this class is useful in applications where vertex and edge specific information is not used; this class is thus a specialization of GraphAdjList with only a single generic parameter that specifies the key type.
The GraphAdjMatrixSimple class can be used to represent adjacency list based graphs in BRIDGES; it takes 1 generic parameter: K, which is an orderable key value used in accessing vertices and edges (in constant time) using hashmaps. This permits data sets that need to be accessed by keys that are strings. Vertex and edge specific information can still be represented, but they will be restricted to be of type K.
The class is simply a wrapper around the Java Hashmap class and, thus, derives all its operations from it. BRIDGES provides methods to visualize the graph and its contents.
The vertices of the graph are held in a Java hashmap of hashmaps(2D hashmap), for near constant time access; this lets us use strings or integral ids for vertices. Edge information is also held in a hashmap with accessor methods.
Convenience methods are provided to add vertices and edges to the graph as well as retrieve the adjacency list of a vertex, given its id. Methods to access and set visual attributes are also provided, indexed by the vertex ids.
K | orderable key (string, int, etc) that is used to index into vertex |
Additional Inherited Members | |
Public Member Functions inherited from bridges.base.GraphAdjMatrix< K, K, K > | |
GraphAdjMatrix () | |
String | getDataStructType () |
void | addVertex (K k, E1 e) |
void | addEdge (K src, K dest) |
void | addEdge (K src, K dest, int weight) |
void | setVertexData (K src, E1 vertex_data) |
Sets data for a graph vertex. More... | |
E1 | getVertexData (K src) |
void | setEdgeData (K src, K dest, E2 data) |
E2 | getEdgeData (K src, K dest) |
HashMap< K, Element< E1 > > | getVertices () |
HashMap< K, HashMap< K, Integer > > | getAdjacencyMatrix () |
HashMap< K, Integer > | getAdjacencyMatrix (K key) |
LinkVisualizer | getLinkVisualizer (K src, K dest) throws Exception |
ElementVisualizer | getVisualizer (K vertex) throws Exception |
String | getDataStructureRepresentation () |