|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--drasys.or.graph.Graph | +--drasys.or.graph.MatrixGraph
This graph is essentially a dense matrix of double values inside a GraphI wrapper.
The origin vertices are associated with the rows and the destination vertices are associated with the columns.
A matrix element value of Double.POSITIVE_INFINITY represents a missing edge.
A missing edge will cause 'getEdge()' to return null and will not be counted in the degree of any vertex.
The edge method 'doubleValue()' returns the double value from the matrix that corresponds to the edge.
The edge method 'getValue()' returns a new instance of 'Double' containing the value.
The vertex method 'doubleValue()' returns a double value based on the vertex value object.
If the value object is not null and either implements 'DoubleI' or is a subclass of 'Number'
then the value is 'value.doubleValue()'.
Otherwise; the value is zero.
References:
Graphs : Theory and Algorithms
K. Thulasiraman, M.N.S. Swamy / Paperback / Published 1992
Fields inherited from class drasys.or.graph.Graph |
_symmetric |
Constructor Summary | |
MatrixGraph(GraphI graph,
java.lang.Object edgeKey)
Initializes the graph from another graph. |
|
MatrixGraph(GraphI graph,
java.lang.Object edgeKey,
EdgePropertiesI properties)
Initializes the graph from another graph. |
|
MatrixGraph(MatrixI cost,
MatrixI time,
MatrixI distance)
Initializes the graph from the values in 'matrix', the matrix must be square. |
|
MatrixGraph(MatrixI cost,
MatrixI time,
MatrixI distance,
java.util.Vector vertexKeys)
Initializes the graph from the values in 'matrix', the matrix must be square. |
|
MatrixGraph(MatrixI cost,
MatrixI time,
MatrixI distance,
java.util.Vector vertexKeys,
java.util.Vector vertexValues)
Initializes the graph from the values in 'matrix', the matrix must be square. |
|
MatrixGraph(MatrixI cost,
MatrixI time,
MatrixI distance,
VertexI[] fromVertices,
VertexI[] toVertices)
Initializes the graph from the values in 'matrix', the matrix can be any rectangular shape. |
Method Summary | |
int |
getChangeCount()
Always returns zero since this graph is immutable. |
EdgeI |
getEdge(VertexI from,
VertexI to,
java.lang.Object edgeKey)
Get the edge between the from and to vertices, the edge key must be null for a match. |
EdgeI |
getMutableEdge(VertexI from,
VertexI to,
java.lang.Object edgeKey)
Get the edge between the from and to vertices, the edge key must be null for a match. |
VertexI |
getVertex(java.lang.Object key)
Get the vertex that matches the key. |
boolean |
isSymmetric()
Returns 'isSymmetric()' from the initialization matrix by default. |
int |
sizeOfDirectedEdges()
|
int |
sizeOfEdges()
|
int |
sizeOfVertices()
|
java.util.Enumeration |
vertices()
Creates an enumeration on the vertices of the graph. |
Methods inherited from class drasys.or.graph.Graph |
edges,
equals,
getEdge,
getEdge,
isSubsetOf,
mutableEdges,
setSymmetric,
toString |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public MatrixGraph(MatrixI cost, MatrixI time, MatrixI distance)
public MatrixGraph(MatrixI cost, MatrixI time, MatrixI distance, java.util.Vector vertexKeys) throws DuplicateVertexException
public MatrixGraph(MatrixI cost, MatrixI time, MatrixI distance, java.util.Vector vertexKeys, java.util.Vector vertexValues) throws DuplicateVertexException
public MatrixGraph(MatrixI cost, MatrixI time, MatrixI distance, VertexI[] fromVertices, VertexI[] toVertices) throws ParallelEdgeException
public MatrixGraph(GraphI graph, java.lang.Object edgeKey)
public MatrixGraph(GraphI graph, java.lang.Object edgeKey, EdgePropertiesI properties)
Method Detail |
public int getChangeCount()
public int sizeOfVertices()
public int sizeOfEdges()
public int sizeOfDirectedEdges()
public boolean isSymmetric()
public EdgeI getMutableEdge(VertexI from, VertexI to, java.lang.Object edgeKey)
public java.util.Enumeration vertices()
public VertexI getVertex(java.lang.Object key)
public EdgeI getEdge(VertexI from, VertexI to, java.lang.Object edgeKey)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |