Bridges-Java  3.4.2
Bridges(Java API)
List of all members
bridges.base.GraphAdjListSimple< K > Class Template Reference
Inheritance diagram for bridges.base.GraphAdjListSimple< K >:
bridges.base.GraphAdjList< K, K, K >

Detailed Description

The GraphAdjListSimple 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 GraphAdjListSimple 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, for near constant time access; this lets us use strings or integral ids for vertices. The adjacency lists, also a Java hashmap are built for each vertex and contain the edge (terminating vertex id, weight) in the Edge structure, defined separately. Adjacency lists are singly linked lists using the BRIDGES SLelement.

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.

Author
Kalpathi Subramanian
Date
4/24/18
Parameters
Korderable key (string, int, etc) that is used to index into vertex
See also
Example tutorial at https://bridgesuncc.github.io/tutorials/Graph.html

Additional Inherited Members

- Public Member Functions inherited from bridges.base.GraphAdjList< K, K, K >
 GraphAdjList ()
 
String getDataStructType ()
 This method gets the data structure type. More...
 
void addVertex (K k, E1 e)
 adds a new vertex to the graph. More...
 
void addEdge (K src, K dest)
 adds a new edge to the graph. More...
 
void addEdge (K src, K dest, E2 data)
 adds a new edge to the graph. More...
 
void setVertexData (K src, E1 vertex_data)
 Sets data for a graph vertex. More...
 
E1 getVertexData (K src)
 Gets data for an edge. More...
 
void setEdgeData (K src, K dest, E2 edge_data)
 Sets data for an edge. More...
 
E2 getEdgeData (K src, K dest)
 Gets data for an edge. More...
 
HashMap< K, Element< E1 > > getVertices ()
 This method returns the graph vertices. More...
 
Element< E1 > getVertex (K key)
 returns a vertex from its key More...
 
HashMap< K, SLelement< Edge< K, E2 > > > getAdjacencyList ()
 Gets the graph's adjacency list. More...
 
SLelement< Edge< K, E2 > > getAdjacencyList (K vertex)
 Gets the adjacency list of a vertex. Note that the list can be traversed using iterators. See example at top of page. More...
 
Iterable< Edge< K, E2 > > outgoingEdgeSetOf (K vertex)
 returns an iterable set of outgoing edge of a vertex More...
 
LinkVisualizer getLinkVisualizer (K src, K dest)
 Access a LinkVisualizer associated with an edge. More...
 
ElementVisualizer getVisualizer (K vertex)
 Access the ElementVisualizer associated with a vertex. More...
 
void forceLargeVisualization (boolean f)
 Forces the graph use the large graph visualization. More...
 
void forceSmallVisualization (boolean f)
 Forces the graph to use the small graph visualization. More...
 
String getDataStructureRepresentation ()
 

The documentation for this class was generated from the following file: