- All Implemented Interfaces:
- java.io.Serializable, DirectedGraph<V,E>, Graph<V,E>
public class AsUnweightedDirectedGraph<V,E>
- extends GraphDelegator<V,E>
- implements java.io.Serializable, DirectedGraph<V,E>
An unweighted view of the backing weighted graph specified in the
constructor. This graph allows modules to apply algorithms designed for
unweighted graphs to a weighted graph by simply ignoring edge weights. Query
operations on this graph "read through" to the backing graph. Vertex
addition/removal and edge addition/removal are all supported (and immediately
reflected in the backing graph).
Note that edges returned by this graph's accessors are really just the
edges of the underlying directed graph.
This graph does not pass the hashCode and equals operations through
to the backing graph, but relies on Object's equals and
hashCode methods. This graph will be serializable if the backing
graph is serializable.
- Sep 7, 2007
- Lucas J. Scharenbroich
- See Also:
- Serialized Form
Returns the weight assigned to a given edge.
|Methods inherited from class org.jgrapht.graph.GraphDelegator
addEdge, addEdge, addVertex, containsEdge, containsVertex, degreeOf, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, incomingEdgesOf, inDegreeOf, outDegreeOf, outgoingEdgesOf, removeEdge, removeEdge, removeVertex, setEdgeWeight, toString, vertexSet
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
|Methods inherited from interface org.jgrapht.Graph
addEdge, addEdge, addVertex, containsEdge, containsEdge, containsVertex, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, removeAllEdges, removeAllEdges, removeAllVertices, removeEdge, removeEdge, removeVertex, vertexSet
public AsUnweightedDirectedGraph(DirectedGraph<V,E> g)
- Constructor for AsUnweightedGraph.
g - the backing graph over which an unweighted view is to be
public double getEdgeWeight(E e)
- Description copied from interface:
- Returns the weight assigned to a given edge. Unweighted graphs return 1.0
(as defined by
weighted-graph algorithms to apply to them where meaningful.
- Specified by:
getEdgeWeight in interface
getEdgeWeight in class
e - edge of interest
- edge weight
- See Also: