public class UndirectedWeightedEdgeGraph<E extends EdgeWeightData,V extends UndirectedEdgeDataVertex<E> & EdgeWeightVertex<E>> extends UndirectedEdgeDataGraph<E,V> implements WeightedEdgeGraph
DEFAULT_WEIGHT_EPSILON
Constructor and Description |
---|
UndirectedWeightedEdgeGraph()
Initialize an empty graph using the default values for weightEpsilon and initial capacity.
|
UndirectedWeightedEdgeGraph(java.util.Collection<V> vertices)
Use the vertices in a collection as the initial vertices in the graph and
set weight epsilon to the default value.
|
UndirectedWeightedEdgeGraph(java.util.Collection<V> vertices,
double weightEpsilon)
Use the vertices in a collection as the initial vertices in the graph and
set weight epsilon to the specified value.
|
UndirectedWeightedEdgeGraph(double weightEpsilon)
Initialize an empty graph using the given value for weightEpsilon and default initial capacity.
|
UndirectedWeightedEdgeGraph(int initialCapacity)
Initialize an empty graph to have capacity for the given number of vertices and
the default weight epsilon.
|
UndirectedWeightedEdgeGraph(int initialCapacity,
double weightEpsilon)
Initialize an empty graph to have capacity for the given number of vertices and
the specified weight epsilon.
|
Modifier and Type | Method and Description |
---|---|
boolean |
areEqualWeights(double w1,
double w2)
Determine if 2 floating point weights are to be considered equal in the given graph.
|
java.util.Set<UndirectedWeightedEdge<E,V>> |
getWeightedEdges()
Return a set containing all weighted edges in the graph.
|
double |
getWeightEpsilon()
Retrieve the epsilon used to determine weight equality in the given graph.
|
edgeCount
addVertex, containsEdge, containsVertex, getVertices, removeVertex, vertexCount, vertexIterator
public UndirectedWeightedEdgeGraph()
public UndirectedWeightedEdgeGraph(double weightEpsilon)
weightEpsilon
- weight epsilon to be used to determine weight equality
in this graphpublic UndirectedWeightedEdgeGraph(java.util.Collection<V> vertices)
vertices
- collection of vertices that will make up the initial vertices
of the graphpublic UndirectedWeightedEdgeGraph(java.util.Collection<V> vertices, double weightEpsilon)
vertices
- collection of vertices that will make up the initial vertices
of the graphweightEpsilon
- weight epsilon to be used to determine weight equality
in this graphpublic UndirectedWeightedEdgeGraph(int initialCapacity)
initialCapacity
- expected number of vertices in the graphpublic UndirectedWeightedEdgeGraph(int initialCapacity, double weightEpsilon)
initialCapacity
- expected number of vertices in the graphweightEpsilon
- weight epsilon to be used to determine weight equality
in this graphpublic boolean areEqualWeights(double w1, double w2)
WeightedEdgeGraph
areEqualWeights
in interface WeightedEdgeGraph
w1
- one of the weights to be tested for equalityw2
- the other weight to be tested for equalitypublic double getWeightEpsilon()
WeightedEdgeGraph
getWeightEpsilon
in interface WeightedEdgeGraph
public java.util.Set<UndirectedWeightedEdge<E,V>> getWeightedEdges()