V
- the graph vertex typeE
- the graph edge typepublic static class CapacitatedSpanningTreeAlgorithm.CapacitatedSpanningTreeImpl<V,E> extends Object implements CapacitatedSpanningTreeAlgorithm.CapacitatedSpanningTree<V,E>, Serializable
Constructor and Description |
---|
CapacitatedSpanningTreeImpl(Map<V,Integer> labels,
Map<Integer,Pair<Set<V>,Double>> partition,
Set<E> edges,
double weight)
Construct a new capacitated spanning tree.
|
Modifier and Type | Method and Description |
---|---|
Set<E> |
getEdges()
Set of edges of the spanning tree.
|
Map<V,Integer> |
getLabels()
Return the set of labels of the underlying partition of the capacitated spanning tree.
|
Map<Integer,Pair<Set<V>,Double>> |
getPartition()
Return the label-to-partition map of the underlying partition of capacitated spanning
tree.
|
double |
getWeight()
Returns the weight of the spanning tree.
|
boolean |
isCapacitatedSpanningTree(Graph<V,E> graph,
V root,
double capacity,
Map<V,Double> demands)
Tests whether
cmst is a CMST on graph with root
root , capacity capacity and demand function
demands . |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
iterator
forEach, spliterator
public CapacitatedSpanningTreeImpl(Map<V,Integer> labels, Map<Integer,Pair<Set<V>,Double>> partition, Set<E> edges, double weight)
labels
- the labelling of the vertices marking their subset membership in the
partitionpartition
- the implicitly defined partition of the vertices in the capacitated
spanning treeedges
- the edge set of the capacitated spanning treeweight
- the weight of the capacitated spanning tree, i.e. the sum of all edge
weightspublic boolean isCapacitatedSpanningTree(Graph<V,E> graph, V root, double capacity, Map<V,Double> demands)
CapacitatedSpanningTreeAlgorithm.CapacitatedSpanningTree
cmst
is a CMST on graph
with root
root
, capacity capacity
and demand function
demands
.isCapacitatedSpanningTree
in interface CapacitatedSpanningTreeAlgorithm.CapacitatedSpanningTree<V,E>
graph
- the graphroot
- the expected root of cmstcapacity
- the expected capacity of cmstdemands
- the demand functioncmst
is a CMSTpublic Map<V,Integer> getLabels()
CapacitatedSpanningTreeAlgorithm.CapacitatedSpanningTree
getLabels
in interface CapacitatedSpanningTreeAlgorithm.CapacitatedSpanningTree<V,E>
public Map<Integer,Pair<Set<V>,Double>> getPartition()
CapacitatedSpanningTreeAlgorithm.CapacitatedSpanningTree
getPartition
in interface CapacitatedSpanningTreeAlgorithm.CapacitatedSpanningTree<V,E>
public double getWeight()
SpanningTreeAlgorithm.SpanningTree
getWeight
in interface SpanningTreeAlgorithm.SpanningTree<E>
public Set<E> getEdges()
SpanningTreeAlgorithm.SpanningTree
getEdges
in interface SpanningTreeAlgorithm.SpanningTree<E>
Copyright © 2019. All rights reserved.