Package org.graph4j.clique
Class BronKerboschCliqueIterator
java.lang.Object
org.graph4j.SimpleGraphAlgorithm
org.graph4j.clique.BronKerboschCliqueIterator
- All Implemented Interfaces:
CliqueIterator,MaximalCliqueIterator
public class BronKerboschCliqueIterator
extends SimpleGraphAlgorithm
implements MaximalCliqueIterator
Iterates over all the maximal cliques of a graph.
Implemented after: Etsuji Tomita, Akira Tanaka, Haruhisa Takahashi, "The
worst-case time complexity for generating all maximal cliques and
computational experiments".
- Author:
- Cristian Frăsinaru
-
Field Summary
Fields inherited from class org.graph4j.SimpleGraphAlgorithm
graph -
Constructor Summary
ConstructorsConstructorDescriptionBronKerboschCliqueIterator(Graph graph) BronKerboschCliqueIterator(Graph graph, boolean shuffle, boolean useAdjacencyMatrix) Using the adjacency matrix allows for a slightly faster execution of the algorithm, at the expense of using more memory.Not recommended for large sparse graphs. -
Method Summary
Methods inherited from class org.graph4j.SimpleGraphAlgorithm
getGraphMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.graph4j.clique.CliqueIterator
getAll
-
Constructor Details
-
BronKerboschCliqueIterator
- Parameters:
graph- the input graph.
-
BronKerboschCliqueIterator
Using the adjacency matrix allows for a slightly faster execution of the algorithm, at the expense of using more memory.Not recommended for large sparse graphs.- Parameters:
graph- the input graph.shuffle- if the vertices are shuffled before.useAdjacencyMatrix-trueif the algorithm will compute and use the adjacency matrix of the graph in order to test if two vertices are adjacent.
-
-
Method Details
-
next
- Specified by:
nextin interfaceCliqueIterator- Returns:
- the next element in the iteration.
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceCliqueIterator- Returns:
trueif the iteration has more elements.
-