java.lang.Object
org.jgrapht.alg.clique.ChordalGraphMaxCliqueFinder<V,E>
- Type Parameters:
V
- the graph vertex type.E
- the graph edge type.
- All Implemented Interfaces:
CliqueAlgorithm<V>
Calculates a maximum cardinality
clique in a chordal graph. A
chordal graph is a simple graph in which all
cycles of four or more vertices have
a chord. A chord is an edge that is
not part of the cycle but connects two vertices of the cycle.
To compute the clique, this implementation relies on the
ChordalityInspector
to compute a
perfect elimination order.
The maximum clique 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.- Author:
- Timofey Chudakov
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jgrapht.alg.interfaces.CliqueAlgorithm
CliqueAlgorithm.Clique<V>, CliqueAlgorithm.CliqueImpl<V>
-
Constructor Summary
ConstructorDescriptionChordalGraphMaxCliqueFinder
(Graph<V, E> graph) Creates a new ChordalGraphMaxCliqueFinder instance.ChordalGraphMaxCliqueFinder
(Graph<V, E> graph, ChordalityInspector.IterationOrder iterationOrder) Creates a new ChordalGraphMaxCliqueFinder instance. -
Method Summary
-
Constructor Details
-
ChordalGraphMaxCliqueFinder
Creates a new ChordalGraphMaxCliqueFinder instance. TheChordalityInspector
used in this implementation uses the defaultMaximumCardinalityIterator
iterator.- Parameters:
graph
- graph
-
ChordalGraphMaxCliqueFinder
public ChordalGraphMaxCliqueFinder(Graph<V, E> graph, ChordalityInspector.IterationOrder iterationOrder) Creates a new ChordalGraphMaxCliqueFinder instance. TheChordalityInspector
used in this implementation uses either theMaximumCardinalityIterator
iterator or theLexBreadthFirstIterator
iterator, depending on the parameteriterationOrder
.- Parameters:
graph
- graphiterationOrder
- constant which defines iterator to be used by theChordalityInspector
in this implementation.
-
-
Method Details
-
getClique
Returns a maximum cardinality clique of the inspectedgraph
. If the graph isn't chordal, returns null.- Specified by:
getClique
in interfaceCliqueAlgorithm<V>
- Returns:
- a maximum clique of the
graph
if it is chordal, null otherwise.
-