V
- the graph vertex typeE
- the graph edge typepublic class GreedyVCImpl<V,E> extends Object implements MinimumWeightedVertexCoverAlgorithm<V,E>
ClarksonTwoApproxVCImpl
.MinimumVertexCoverAlgorithm.VertexCover<V>, MinimumVertexCoverAlgorithm.VertexCoverImpl<V>
Constructor and Description |
---|
GreedyVCImpl() |
Modifier and Type | Method and Description |
---|---|
MinimumVertexCoverAlgorithm.VertexCover<V> |
getVertexCover(UndirectedGraph<V,E> graph,
Map<V,Double> vertexWeightMap)
Finds a greedy solution to the minimum weighted vertex cover problem.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getVertexCover
public MinimumVertexCoverAlgorithm.VertexCover<V> getVertexCover(UndirectedGraph<V,E> graph, Map<V,Double> vertexWeightMap)
weight(v)/degree(v)
and adds it
to the cover. Next vertex v and all edges incident to it are removed. The process repeats
until all vertices are covered. Runtime: O(|E|*log|V|)getVertexCover
in interface MinimumWeightedVertexCoverAlgorithm<V,E>
graph
- input graphvertexWeightMap
- mapping of vertex weightsCopyright © 2016. All rights reserved.