Package micycle.pgs

Enum Class PGS_Coloring.ColoringAlgorithm

java.lang.Object
java.lang.Enum<PGS_Coloring.ColoringAlgorithm>
micycle.pgs.PGS_Coloring.ColoringAlgorithm
All Implemented Interfaces:
Serializable, Comparable<PGS_Coloring.ColoringAlgorithm>, Constable
Enclosing class:
PGS_Coloring

public static enum PGS_Coloring.ColoringAlgorithm extends Enum<PGS_Coloring.ColoringAlgorithm>
Specifies the algorithm/heuristic used by the underlying graph coloring process to find an approximate minimal coloring for mesh faces. RLF, followed by DSATUR generally produce the "best" colorings (as measured by chromatic number, where lower is better).
  • Enum Constant Details

    • RANDOM

      public static final PGS_Coloring.ColoringAlgorithm RANDOM
      The greedy coloring algorithm with a random vertex ordering.
    • LARGEST_DEGREE_FIRST

      public static final PGS_Coloring.ColoringAlgorithm LARGEST_DEGREE_FIRST
      The largest degree first greedy coloring algorithm.

      This algorithm orders the vertices in decreasing order of degree, the idea being that the large degree vertices can be colored more easily.

    • SMALLEST_DEGREE_LAST

      public static final PGS_Coloring.ColoringAlgorithm SMALLEST_DEGREE_LAST
      The smallest degree last greedy coloring algorithm. This is the greedy coloring algorithm with the smallest-last ordering of the vertices.
    • DSATUR

      public static final PGS_Coloring.ColoringAlgorithm DSATUR
      DSATUR (saturation degree ordering) is a variant on Largest Degree Ordering where the vertices are ordered in decreasing order by "saturation degree", defined as the number of distinct colors in the vertex neighborhood.
    • COARSE

      public static final PGS_Coloring.ColoringAlgorithm COARSE
      Finds the coarsest coloring of a graph.
    • RLF

      public static final PGS_Coloring.ColoringAlgorithm RLF
      Recursive largest-first coloring (recommended).
    • RLF_BRUTE_FORCE_4COLOR

      public static final PGS_Coloring.ColoringAlgorithm RLF_BRUTE_FORCE_4COLOR
      Repeatedly calls the recursive largest-first (RLF) algorithm until a 4-coloring (or less) is found. The operation will break after 250 attempts if a 4-coloring (or less) is still not found; in this case, the result from the final attempt is returned.
    • GENETIC

      public static final PGS_Coloring.ColoringAlgorithm GENETIC
      Finds a coloring using a genetic algorithm. Unlike all other algorithms this specifically targets a chromaticity of 4 (falls back to 5 if no solution is found).
  • Method Details

    • values

      public static PGS_Coloring.ColoringAlgorithm[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PGS_Coloring.ColoringAlgorithm valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null