Module logicng

Class GraphDimacsFileWriter


  • public final class GraphDimacsFileWriter
    extends Object
    A dimacs file writer for graphs. Writes the internal data structure of a graph to a dimacs file.
    Since:
    1.2
    Version:
    2.4.0
    • Method Detail

      • write

        public static <T> void write​(String fileName,
                                     Graph<T> graph,
                                     boolean writeMapping)
                              throws IOException
        Writes a given graph's internal data structure as a dimacs file.
        Type Parameters:
        T - the type of the graph content
        Parameters:
        fileName - the file name of the dimacs file to write, will be extended by suffix .col if not already present
        graph - the graph
        writeMapping - indicates whether an additional file for translating the ids to variable names shall be written
        Throws:
        IOException - if there was a problem writing the file