Bridges-Java-2.3.2  2.3.2
Bridges(JavaAPI)
Public Member Functions | List of all members
bridges.base.GraphAdjMatrix< K, E > Class Template Reference

The GraphAdjMatrix class can be used to represent adjacency matrix based * graphs in BRIDGES. More...

Inheritance diagram for bridges.base.GraphAdjMatrix< K, E >:
bridges.base.DataStruct

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

- Protected Member Functions inherited from bridges.base.DataStruct
abstract String getDataStructType ()
 
- Protected Attributes inherited from bridges.base.DataStruct
String QUOTE = "\""
 

Detailed Description

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

Author
Kalpathi Subramanian, Mihai Mehedint
Date
7/12/15

Constructor & Destructor Documentation

Constructor

Member Function Documentation

void bridges.base.GraphAdjMatrix< K, E >.addEdge ( src,
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.

Parameters
src- source vertex of edge
dest- destination vertex of edge
weight- edge weight
Returns
none
void bridges.base.GraphAdjMatrix< K, E >.addVertex ( k,
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

Parameters
K- vertex key value
Returns
none
HashMap<K, HashMap<K, Integer> > bridges.base.GraphAdjMatrix< K, E >.getAdjacencyMatrix ( )

Gets the adjacency matrix

Returns
- the graph's adjacency lists
String bridges.base.GraphAdjMatrix< K, E >.getDataStructType ( )

This method gets the data structure type

Returns
The date structure type as a string
HashMap<K, Element<E> > bridges.base.GraphAdjMatrix< K, E >.getVertices ( )

This method returns the graph nodes

Returns
– vertices held in an unordered map

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