Enum DIMACSFormat

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DIMACSFormat>

    public enum DIMACSFormat
    extends java.lang.Enum<DIMACSFormat>
    DIMACS challenge format.

    For a general description of the formats see http://dimacs.rutgers.edu/Challenges. Note that there are a lot of different formats based on each different challenge.

    Author:
    Dimitrios Michail
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      COLORING
      Coloring format.
      MAX_CLIQUE
      Max-clique challenge format.
      SHORTEST_PATH
      Shortest path challenge format.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getEdgeDescriptor()
      Get the edge descriptor used in the format.
      java.lang.String getProblem()
      Get the name of the problem.
      static DIMACSFormat valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static DIMACSFormat[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • SHORTEST_PATH

        public static final DIMACSFormat SHORTEST_PATH
        Shortest path challenge format.

        This is the format used in the 9th DIMACS implementation challenge. A shortest path graph file looks as follows:

         
         c <comments>
         p sp <number of nodes> <number of edges>
         a <edge source 1> <edge target 1>
         a <edge source 2> <edge target 2>
         a <edge source 3> <edge target 3>
         a <edge source 4> <edge target 4>
         ...
         
         
        A weighted variant where each edge has a floating-point weight is also supported:
         
         a <edge source 1> <edge target 1> <edge_weight> 
         
         
      • MAX_CLIQUE

        public static final DIMACSFormat MAX_CLIQUE
        Max-clique challenge format.

        This is the format used in the 2nd DIMACS implementation challenge. A graph file looks as follows:

         
         c <comments>
         p edge <number of nodes> <number of edges>
         e <edge source 1> <edge target 1>
         e <edge source 2> <edge target 2>
         e <edge source 3> <edge target 3>
         e <edge source 4> <edge target 4>
         ...
         
         
        A weighted variant where each edge has a floating-point weight is also supported:
         
         e <edge source 1> <edge target 1> <edge_weight> 
         
         
      • COLORING

        public static final DIMACSFormat COLORING
        Coloring format.

        This is the format used in the 2nd DIMACS implementation challenge. Same as the MAX_CLIQUE but uses "col" instead of "edge" in the problem definition line.

    • Method Detail

      • values

        public static DIMACSFormat[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DIMACSFormat c : DIMACSFormat.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DIMACSFormat valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getProblem

        public java.lang.String getProblem()
        Get the name of the problem.
        Returns:
        the name of the problem.
      • getEdgeDescriptor

        public java.lang.String getEdgeDescriptor()
        Get the edge descriptor used in the format.
        Returns:
        the edge descriptor