Package org.neo4j.gds.beta.k1coloring
Class K1Coloring
- java.lang.Object
-
- org.neo4j.gds.Algorithm<org.neo4j.gds.core.utils.paged.HugeLongArray>
-
- org.neo4j.gds.beta.k1coloring.K1Coloring
-
public class K1Coloring extends org.neo4j.gds.Algorithm<org.neo4j.gds.core.utils.paged.HugeLongArray>This is a parallel implementation of the K1-Coloring algorithm. The Algorithm will assign a color to every node in the graph, trying to optimize for two objectives:
- given a single node, make sure that every neigbor of that node has a different color
- use as little colors as possible
The implementation is a greedy implementation based on:
Çatalyürek, Ümit V., et al. "Graph coloring algorithms for multi-core and massively multithreaded architectures." Parallel Computing 38.10-11 (2012): 576-594. https://arxiv.org/pdf/1205.3809.pdfThe implementation is greedy, so it is not garantied to find an optimal solution, i.e. the coloring can be imperfect and contain more colors as needed.
-
-
Constructor Summary
Constructors Constructor Description K1Coloring(org.neo4j.gds.api.Graph graph, long maxIterations, int minBatchSize, int concurrency, java.util.concurrent.ExecutorService executor, org.neo4j.gds.core.utils.progress.tasks.ProgressTracker progressTracker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.neo4j.gds.core.utils.paged.HugeLongArraycolors()org.neo4j.gds.core.utils.paged.HugeLongArraycompute()booleandidConverge()longranIterations()voidrelease()com.carrotsearch.hppc.BitSetusedColors()
-
-
-
Method Detail
-
release
public void release()
- Specified by:
releasein classorg.neo4j.gds.Algorithm<org.neo4j.gds.core.utils.paged.HugeLongArray>
-
ranIterations
public long ranIterations()
-
didConverge
public boolean didConverge()
-
usedColors
public com.carrotsearch.hppc.BitSet usedColors()
-
colors
public org.neo4j.gds.core.utils.paged.HugeLongArray colors()
-
compute
public org.neo4j.gds.core.utils.paged.HugeLongArray compute()
- Specified by:
computein classorg.neo4j.gds.Algorithm<org.neo4j.gds.core.utils.paged.HugeLongArray>
-
-