V- the graph vertex type
E- the graph edge type
public class GreedyVCImpl<V,E> extends Object implements MinimumWeightedVertexCoverAlgorithm<V,E>
|Constructor and Description|
|Modifier and Type||Method and Description|
Finds a greedy solution to the minimum weighted vertex cover problem.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public MinimumVertexCoverAlgorithm.VertexCover<V> getVertexCover(Graph<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|)
Copyright © 2017. All rights reserved.