V
- the graph vertex type.E
- the graph edge type.public class ChordalGraphIndependentSetFinder<V,E> extends Object implements IndependentSetAlgorithm<V>
ChordalityInspector
to
compute a
perfect elimination order.
The maximum cardinality independent set for a chordal graph is computed in $\mathcal{O}(|V| +
|E|)$ time.
All the methods in this class are invoked in a lazy fashion, meaning that computations are only
started once the method gets invoked.IndependentSetAlgorithm.IndependentSet<V>, IndependentSetAlgorithm.IndependentSetImpl<V>
Constructor and Description |
---|
ChordalGraphIndependentSetFinder(Graph<V,E> graph)
Creates a new ChordalGraphIndependentSetFinder instance.
|
ChordalGraphIndependentSetFinder(Graph<V,E> graph,
ChordalityInspector.IterationOrder iterationOrder)
Creates a new ChordalGraphIndependentSetFinder instance.
|
Modifier and Type | Method and Description |
---|---|
IndependentSetAlgorithm.IndependentSet<V> |
getIndependentSet()
Returns a maximum
cardinality independent set of the inspected
graph . |
public ChordalGraphIndependentSetFinder(Graph<V,E> graph)
ChordalityInspector
used
in this implementation uses the default MaximumCardinalityIterator
iterator.graph
- graphpublic ChordalGraphIndependentSetFinder(Graph<V,E> graph, ChordalityInspector.IterationOrder iterationOrder)
ChordalityInspector
used
in this implementation uses either the MaximumCardinalityIterator
iterator or the
LexBreadthFirstIterator
iterator, depending on the parameter iterationOrder
.graph
- graphiterationOrder
- constant which defines iterator to be used by the
ChordalityInspector
in this implementation.public IndependentSetAlgorithm.IndependentSet<V> getIndependentSet()
graph
. If the graph isn't chordal,
returns null.getIndependentSet
in interface IndependentSetAlgorithm<V>
graph
if it is chordal, null otherwise.Copyright © 2019. All rights reserved.