Open
Graph Drawing
Framework

 v. snapshot-2018-03-28
 

Utility class providing graph I/O in various exchange formats. More...

#include <ogdf/fileformats/GraphIO.h>

Classes

class  SVGSettings
 Condensed settings for drawing SVGs. More...
 

Public Types

using AttrReaderFunc = bool(*)(GraphAttributes &, Graph &, std::istream &)
 Type of simple graph attributes reader functions working on streams. More...
 
using AttrWriterFunc = bool(*)(const GraphAttributes &, std::ostream &)
 Type of simple graph attributes writer functions working on streams. More...
 
using ReaderFunc = bool(*)(Graph &, std::istream &)
 Type of simple graph reader functions working on streams. More...
 
using WriterFunc = bool(*)(const Graph &, std::ostream &)
 Type of simple graph writer functions working on streams. More...
 

Static Public Member Functions

Graphs

These functions read and write graphs (instances of type Graph) in various graph formats.

static bool read (Graph &G, const string &filename, ReaderFunc reader=GraphIO::read)
 Reads arbitrary format from a file specified by name. More...
 
static bool write (const Graph &G, const string &filename, WriterFunc writer)
 Writes arbitrary format to a file specified by name. More...
 
static bool read (Graph &G, std::istream &is)
 Reads graph G of arbitrary graph format from filename. More...
 
static bool read (GraphAttributes &GA, Graph &G, const string &filename, AttrReaderFunc reader)
 Reads arbitrary format from a file specified by name. More...
 
static bool write (const GraphAttributes &GA, const string &filename, AttrWriterFunc writer)
 Writes arbitrary format to a file specified by name. More...
 
GML
static bool readGML (Graph &G, const string &filename)
 Reads graph G in GML format from file filename. More...
 
static bool readGML (Graph &G, std::istream &is)
 Reads graph G in GML format from input stream is. More...
 
static bool writeGML (const Graph &G, const string &filename)
 Writes graph G in GML format to file filename. More...
 
static bool writeGML (const Graph &G, std::ostream &os)
 Writes graph G in GML format to output stream os. More...
 
static bool readGML (ClusterGraph &C, Graph &G, const string &filename)
 Reads clustered graph (C, G) in GML format from file filename. More...
 
static bool readGML (ClusterGraph &C, Graph &G, std::istream &is)
 Reads clustered graph (C, G) in GML format from input stream is. More...
 
static bool writeGML (const ClusterGraph &C, const string &filename)
 Writes clustered graph C in GML format to file filename. More...
 
static bool writeGML (const ClusterGraph &C, std::ostream &os)
 Writes clustered graph C in GML format to output stream os. More...
 
static bool readGML (ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, const string &filename)
 Reads clustered graph (C, G) with attributes A in GML format from file filename. More...
 
static bool readGML (ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, std::istream &is)
 Reads clustered graph (C, G) with attributes A in GML format from input stream is. More...
 
static bool writeGML (const ClusterGraphAttributes &A, const string &filename)
 Writes graph with attributes A in GML format to file filename. More...
 
static bool writeGML (const ClusterGraphAttributes &A, std::ostream &os)
 Writes graph with attributes A in GML format to output stream os. More...
 
static bool readGML (GraphAttributes &A, Graph &G, const string &filename)
 Reads graph G with attributes A in GML format from file filename. More...
 
static bool readGML (GraphAttributes &A, Graph &G, std::istream &is)
 Reads graph G with attributes A in GML format from input stream is. More...
 
static bool writeGML (const GraphAttributes &A, const string &filename)
 Writes graph with attributes A in GML format to file filename. More...
 
static bool writeGML (const GraphAttributes &A, std::ostream &os)
 Writes graph with attributes A in GML format to output stream os. More...
 
Rome
static bool readRome (Graph &G, const string &filename)
 Reads graph G in Rome-Lib format from file filename. More...
 
static bool readRome (Graph &G, std::istream &is)
 Reads graph G in Rome-Lib format from input stream is. More...
 
static bool writeRome (const Graph &G, const string &filename)
 Writes graph G in Rome-Lib format to file filename. More...
 
static bool writeRome (const Graph &G, std::ostream &os)
 Writes graph G in Rome-Lib format to output stream os. More...
 
LEDA
static bool readLEDA (Graph &G, const string &filename)
 Reads graph G in LEDA graph format from file filename. More...
 
static bool readLEDA (Graph &G, std::istream &is)
 Reads graph G in LEDA graph format from input stream is. More...
 
static bool writeLEDA (const Graph &G, const string &filename)
 Writes graph G in LEDA graph format to file filename. More...
 
static bool writeLEDA (const Graph &G, std::ostream &os)
 Writes graph G in LEDA graph format to output stream os. More...
 
Chaco
static bool readChaco (Graph &G, const string &filename)
 Reads graph G in Chaco format from file filename. More...
 
static bool readChaco (Graph &G, std::istream &is)
 Reads graph G in Chaco format from input stream is. More...
 
static bool writeChaco (const Graph &G, const string &filename)
 Writes graph G in Chaco format to file filename. More...
 
static bool writeChaco (const Graph &G, std::ostream &os)
 Writes graph G in Chaco format to output stream os. More...
 
PMDissGraph

Graph file format from [Petra Mutzel, The maximum planar subgraph problem, PhD Thesis, Köln University, 1994]

static bool readPMDissGraph (Graph &G, const string &filename)
 Reads graph G in a simple format as used in Petra Mutzel's thesis from file filename. More...
 
static bool readPMDissGraph (Graph &G, std::istream &is)
 Reads graph G in a simple format as used in Petra Mutzel's thesis from input stream is. More...
 
static bool writePMDissGraph (const Graph &G, const string &filename)
 Writes graph G in a simple format as used in Petra Mutzel's thesis to file filename. More...
 
static bool writePMDissGraph (const Graph &G, std::ostream &os)
 Writes graph G in a simple format as used in Petra Mutzel's thesis to output stream os. More...
 
YGraph
static bool readYGraph (Graph &G, const string &filename)
 Reads graph G in Y-graph format from file filename. More...
 
static bool readYGraph (Graph &G, std::istream &is)
 Reads graph G in Y-graph format from input stream is. More...
 
Graph6

The Graph6 format represents an (preferable dense or small) simple undirected graph as a string containing printable characters between 0x3F and 0x7E.

See the specification for more information.

static bool readGraph6 (Graph &G, const string &filename, bool forceHeader=false)
 Reads graph G in Graph6 format from file filename. More...
 
static bool readGraph6 (Graph &G, std::istream &is, bool forceHeader=false)
 Reads graph G in Graph6 format from input stream is. More...
 
static bool writeGraph6 (const Graph &G, const string &filename)
 Writes graph G in Graph6 format to file filename. More...
 
static bool writeGraph6 (const Graph &G, std::ostream &os)
 Writes graph G in Graph6 format to output stream os. More...
 
MatrixMarket
static bool readMatrixMarket (Graph &G, std::istream &inStream)
 Reads graph G in Matrix Market exchange format from stream inStream. More...
 
static bool readMatrixMarket (Graph &G, const string &filename)
 Reads graph G in Matrix Market exchange format from a file with the given filename. More...
 
Rudy
static bool readRudy (GraphAttributes &A, Graph &G, const string &filename)
 Reads graph G with edge weights stored in A in Rudy format from file filename. More...
 
static bool readRudy (GraphAttributes &A, Graph &G, std::istream &is)
 Reads graph G with edge weights stored in A in Rudy format from input stream is. More...
 
static bool writeRudy (const GraphAttributes &A, const string &filename)
 Writes graph with edge weights stored in A in Rudy format to file filename. More...
 
static bool writeRudy (const GraphAttributes &A, std::ostream &os)
 Writes graph with edge weights stored in A in Rudy format to output stream os. More...
 
BENCH
static bool readBENCH (Graph &G, List< node > &hypernodes, List< edge > *shell, const string &filename)
 Reads a hypergraph (as point-based expansion) in BENCH format from file filename. More...
 
static bool readBENCH (Graph &G, List< node > &hypernodes, List< edge > *shell, std::istream &is)
 Reads a hypergraph (as point-based expansion) in BENCH format from input stream is. More...
 
PLA
static bool readPLA (Graph &G, List< node > &hypernodes, List< edge > *shell, const string &filename)
 Reads a hypergraph (as point-based expansion) in PLA format from file filename. More...
 
static bool readPLA (Graph &G, List< node > &hypernodes, List< edge > *shell, std::istream &is)
 Reads a hypergraph (as point-based expansion) in PLA format from input stream is. More...
 
GD-Challenge

Graph Drawing Challenge: Area Minimization for Orthogonal Grid Layouts http://graphdrawing.de/contest2013/challenge.html

static bool readChallengeGraph (Graph &G, GridLayout &gl, const string &filename)
 Reads graph G with grid layout gl in GD-Challenge-format from file filename. More...
 
static bool readChallengeGraph (Graph &G, GridLayout &gl, std::istream &is)
 Reads graph G with grid layout gl in GD-Challenge-format from input stream is. More...
 
static bool writeChallengeGraph (const Graph &G, const GridLayout &gl, const string &filename)
 Writes graph G with grid layout gl in GD-Challenge-format to file filename. More...
 
static bool writeChallengeGraph (const Graph &G, const GridLayout &gl, std::ostream &os)
 Writes graph G with grid layout gl in GD-Challenge-format to output stream os. More...
 
GraphML

Graph Markup Language: http://graphml.graphdrawing.org/

static bool readGraphML (Graph &G, const string &filename)
 Reads graph G in GraphML format from file filename. More...
 
static bool readGraphML (Graph &G, std::istream &is)
 Reads graph G in GraphML format from input stream is. More...
 
static bool readGraphML (ClusterGraph &C, Graph &G, const string &filename)
 Reads clustered graph (C, G) in GraphML format from file filename. More...
 
static bool readGraphML (ClusterGraph &C, Graph &G, std::istream &is)
 Reads clustered graph (C, G) in GraphML format from input stream is. More...
 
static bool readGraphML (GraphAttributes &A, Graph &G, const string &filename)
 Reads graph G with attributes A in GraphML format from file filename. More...
 
static bool readGraphML (GraphAttributes &A, Graph &G, std::istream &is)
 Reads graph G with attributes A in GraphML format from input stream is. More...
 
static bool readGraphML (ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, const string &filename)
 Reads clustered graph (C, G) with attributes A in GraphML format from file filename. More...
 
static bool readGraphML (ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, std::istream &is)
 Reads clustered graph (C, G) with attributes A in GraphML format from input stream is. More...
 
static bool writeGraphML (const Graph &G, const string &filename)
 Writes graph G in GraphML format to file filename. More...
 
static bool writeGraphML (const Graph &G, std::ostream &os)
 Writes graph G in GraphML format to output stream os. More...
 
static bool writeGraphML (const ClusterGraph &C, const string &filename)
 Writes clustered graph C in GraphML format to file filename. More...
 
static bool writeGraphML (const ClusterGraph &C, std::ostream &os)
 Writes clustered graph C in GraphML format to output stream os. More...
 
static bool writeGraphML (const GraphAttributes &A, const string &filename)
 Writes graph with attributes A in GraphML format to file filename. More...
 
static bool writeGraphML (const GraphAttributes &A, std::ostream &os)
 Writes graph with attributes A in GraphML format to output stream os. More...
 
static bool writeGraphML (const ClusterGraphAttributes &A, const string &filename)
 Writes graph with attributes A in GraphML format to file filename. More...
 
static bool writeGraphML (const ClusterGraphAttributes &A, std::ostream &os)
 Writes graph with attributes A in GraphML format to output stream os. More...
 
DOT
static bool readDOT (Graph &G, const string &filename)
 Reads graph G in DOT format from file filename. More...
 
static bool readDOT (Graph &G, std::istream &is)
 Reads graph G in DOT format from input stream is. More...
 
static bool readDOT (ClusterGraph &C, Graph &G, const string &filename)
 Reads clustered graph (C, G) in DOT format from file filename. More...
 
static bool readDOT (ClusterGraph &C, Graph &G, std::istream &is)
 Reads clustered graph (C, G) in DOT format from input stream is. More...
 
static bool readDOT (GraphAttributes &A, Graph &G, const string &filename)
 Reads graph G with attributes A in DOT format from file filename. More...
 
static bool readDOT (GraphAttributes &A, Graph &G, std::istream &is)
 Reads graph G with attributes A in DOT format from input stream is. More...
 
static bool readDOT (ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, const string &filename)
 Reads clustered graph (C, G) with attributes A in DOT format from file filename. More...
 
static bool readDOT (ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, std::istream &is)
 Reads clustered graph (C, G) with attributes A in DOT format from input stream is. More...
 
static bool writeDOT (const Graph &G, const string &filename)
 Writes graph G in DOT format to file filename. More...
 
static bool writeDOT (const Graph &G, std::ostream &os)
 Writes graph G in DOT format to output stream os. More...
 
static bool writeDOT (const ClusterGraph &C, const string &filename)
 Writes clustered graph C in DOT format to file filename. More...
 
static bool writeDOT (const ClusterGraph &C, std::ostream &os)
 Writes clustered graph C in DOT format to output stream os. More...
 
static bool writeDOT (const GraphAttributes &A, const string &filename)
 Writes graph with attributes A in DOT format to file filename. More...
 
static bool writeDOT (const GraphAttributes &A, std::ostream &os)
 Writes graph with attributes A in DOT format to output stream os. More...
 
static bool writeDOT (const ClusterGraphAttributes &A, const string &filename)
 Writes graph with attributes A in DOT format to file filename. More...
 
static bool writeDOT (const ClusterGraphAttributes &A, std::ostream &os)
 Writes graph with attributes A in DOT format to output stream os. More...
 
GEXF

Graph Exchange XML Format: https://gephi.org/gexf/format/

static bool readGEXF (Graph &G, const string &filename)
 Reads graph G in GEXF format from file filename. More...
 
static bool readGEXF (Graph &G, std::istream &is)
 Reads graph G in GEXF format from input stream is. More...
 
static bool readGEXF (ClusterGraph &C, Graph &G, const string &filename)
 Reads clustered graph (C, G) in GEXF format from file filename. More...
 
static bool readGEXF (ClusterGraph &C, Graph &G, std::istream &is)
 Reads clustered graph (C, G) in GEXF format from input stream is. More...
 
static bool readGEXF (GraphAttributes &A, Graph &G, const string &filename)
 Reads graph G with attributes A in GEXF format from file filename. More...
 
static bool readGEXF (GraphAttributes &A, Graph &G, std::istream &is)
 Reads graph G with attributes A in GEXF format from input stream is. More...
 
static bool readGEXF (ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, const string &filename)
 Reads clustered graph (C, G) with attributes A in GEXF format from file filename. More...
 
static bool readGEXF (ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, std::istream &is)
 Reads clustered graph (C, G) with attributes A in GEXF format from input stream is. More...
 
static bool writeGEXF (const Graph &G, const string &filename)
 Writes graph G in GEXF format to file filename. More...
 
static bool writeGEXF (const Graph &G, std::ostream &os)
 Writes graph G in GEXF format to output stream os. More...
 
static bool writeGEXF (const ClusterGraph &C, const string &filename)
 Writes clustered graph C in GEXF format to file filename. More...
 
static bool writeGEXF (const ClusterGraph &C, std::ostream &os)
 Writes clustered graph C in GEXF format to output stream os. More...
 
static bool writeGEXF (const GraphAttributes &A, const string &filename)
 Writes graph with attributes A in GEXF format to file filename. More...
 
static bool writeGEXF (const GraphAttributes &A, std::ostream &os)
 Writes graph with attributes A in GEXF format to output stream os. More...
 
static bool writeGEXF (const ClusterGraphAttributes &A, const string &filename)
 Writes graph with attributes A in GEXF format to file filename. More...
 
static bool writeGEXF (const ClusterGraphAttributes &A, std::ostream &os)
 Writes graph with attributes A in GEXF format to output stream os. More...
 
GDF
static bool readGDF (Graph &G, const string &filename)
 Reads graph G in GDF format from file filename. More...
 
static bool readGDF (Graph &G, std::istream &is)
 Reads graph G in GDF format from input stream is. More...
 
static bool readGDF (GraphAttributes &A, Graph &G, const string &filename)
 Reads graph G with attributes A in GDF format from file filename. More...
 
static bool readGDF (GraphAttributes &A, Graph &G, std::istream &is)
 Reads graph G with attributes A in GDF format from input stream is. More...
 
static bool writeGDF (const Graph &G, const string &filename)
 Writes graph G in GDF format to file filename. More...
 
static bool writeGDF (const Graph &G, std::ostream &os)
 Writes graph G in GDF format to output stream os. More...
 
static bool writeGDF (const GraphAttributes &A, const string &filename)
 Writes graph with attributes A in GDF format to file filename. More...
 
static bool writeGDF (const GraphAttributes &A, std::ostream &os)
 Writes graph with attributes A in GDF format to output stream os. More...
 
TLP
static bool readTLP (Graph &G, const string &filename)
 Reads graph G in TLP format from file filename. More...
 
static bool readTLP (Graph &G, std::istream &is)
 Reads graph G in TLP format from input stream is. More...
 
static bool readTLP (ClusterGraph &C, Graph &G, const string &filename)
 Reads clustered graph (C, G) in TLP format from file filename. More...
 
static bool readTLP (ClusterGraph &C, Graph &G, std::istream &is)
 Reads clustered graph (C, G) in TLP format from input stream is. More...
 
static bool readTLP (GraphAttributes &A, Graph &G, const string &filename)
 Reads graph G with attributes A in TLP format from file filename. More...
 
static bool readTLP (GraphAttributes &A, Graph &G, std::istream &is)
 Reads graph G with attributes A in TLP format from input stream is. More...
 
static bool readTLP (ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, const string &filename)
 Reads clustered graph (C, G) with attributes A in TLP format from file filename. More...
 
static bool readTLP (ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, std::istream &is)
 Reads clustered graph (C, G) with attributes A in TLP format from input stream is. More...
 
static bool writeTLP (const Graph &G, const string &filename)
 Writes graph G in TLP format to file filename. More...
 
static bool writeTLP (const Graph &G, std::ostream &os)
 Writes graph G in TLP format to output stream os. More...
 
static bool writeTLP (const ClusterGraph &C, const string &filename)
 Writes clustered graph C in TLP format to file filename. More...
 
static bool writeTLP (const ClusterGraph &C, std::ostream &os)
 Writes clustered graph C in TLP format to output stream os. More...
 
static bool writeTLP (const GraphAttributes &A, const string &filename)
 Writes graph with attributes A in TLP format to file filename. More...
 
static bool writeTLP (const GraphAttributes &A, std::ostream &os)
 Writes graph with attributes A in TLP format to output stream os. More...
 
static bool writeTLP (const ClusterGraphAttributes &A, const string &filename)
 Writes graph with attributes A in TLP format to file filename. More...
 
static bool writeTLP (const ClusterGraphAttributes &A, std::ostream &os)
 Writes graph with attributes A in TLP format to output stream os. More...
 
DL
static bool readDL (Graph &G, const string &filename)
 Reads graph G in DL format from file filename. More...
 
static bool readDL (Graph &G, std::istream &is)
 Reads graph G in DL format from input stream is. More...
 
static bool readDL (GraphAttributes &A, Graph &G, const string &filename)
 Reads graph G with attributes A in DL format from file filename. More...
 
static bool readDL (GraphAttributes &A, Graph &G, std::istream &is)
 Reads graph G with attributes A in DL format from input stream is. More...
 
static bool writeDL (const Graph &G, const string &filename)
 Writes graph G in DL format to file filename. More...
 
static bool writeDL (const Graph &G, std::ostream &os)
 Writes graph G in DL format to output stream os. More...
 
static bool writeDL (const GraphAttributes &A, const string &filename)
 Writes graph with attributes A in DL format to file filename. More...
 
static bool writeDL (const GraphAttributes &A, std::ostream &os)
 Writes graph with attributes A in DL format to output stream os. More...
 
STP

SteinLib STP Data Format: http://steinlib.zib.de/format.php

static bool readSTP (Graph &G, std::istream &is)
 Reads a graph in SteinLib format from std::istream is. More...
 
template<typename T >
static bool readSTP (EdgeWeightedGraph< T > &wG, List< node > &terminals, NodeArray< bool > &isTerminal, const string &filename)
 Reads a SteinLib instance from file filename and converts it into a weighted graph wG and a set of terminal nodes terminals. More...
 
template<typename T >
static bool readSTP (EdgeWeightedGraph< T > &wG, List< node > &terminals, NodeArray< bool > &isTerminal, std::istream &is)
 Reads a SteinLib instance from an inputstream is and converts it into a weighted graph wG and a set of terminal nodes terminals. More...
 
template<typename T >
static bool writeSTP (const EdgeWeightedGraph< T > &wG, const List< node > &terminals, const string &filename, const string &comments="")
 Writes an Steiner problem instance to an STP file. More...
 
template<typename T >
static bool writeSTP (const EdgeWeightedGraph< T > &wG, const List< node > &terminals, std::ostream &os, const string &comments="")
 Writes an Steiner problem instance to an STP file. More...
 
DMF

DIMACS Max Flow Challenge: ftp://dimacs.rutgers.edu/pub/netflow/

template<typename T >
static bool readDMF (Graph &graph, EdgeArray< T > &weights, node &source, node &sink, const string &filename)
 Reads a maximum flow instance in DIMACS format. More...
 
template<typename T >
static bool readDMF (Graph &graph, EdgeArray< T > &weights, node &source, node &sink, std::istream &is)
 Reads a maximum flow instance in DIMACS format. More...
 
template<typename T >
static bool writeDMF (const Graph &graph, const EdgeArray< T > &weights, const node source, const node sink, const string &filename)
 Writes a maximum flow problem instance to a DIMACS maximum flow file. More...
 
template<typename T >
static bool writeDMF (const Graph &graph, const EdgeArray< T > &weights, const node source, const node sink, std::ostream &os)
 Writes a maximum flow problem instance to a DIMACS maximum flow file. More...
 
Graphs with subgraph

These functions read and write graphs in a simple text-based file format that also specifies a subgraph (given as a list of edges).

static bool readEdgeListSubgraph (Graph &G, List< edge > &delEdges, const string &filename)
 Reads graph G with subgraph defined by delEdges from file filename. More...
 
static bool readEdgeListSubgraph (Graph &G, List< edge > &delEdges, std::istream &is)
 Reads graph G with subgraph defined by delEdges from stream is. More...
 
static bool writeEdgeListSubgraph (const Graph &G, const List< edge > &delEdges, const string &filename)
 Writes graph G with subgraph defined by delEdges to file filename. More...
 
static bool writeEdgeListSubgraph (const Graph &G, const List< edge > &delEdges, std::ostream &os)
 Writes graph G with subgraph defined by delEdges to stream os. More...
 
Graphics formats

These functions draw graphs and export them as SVG (Scalable Vector Graphics) vectors graphics.

static bool drawSVG (const GraphAttributes &A, const string &filename, const SVGSettings &settings=svgSettings)
 
static bool drawSVG (const GraphAttributes &A, std::ostream &os, const SVGSettings &settings)
 
static bool drawSVG (const GraphAttributes &A, std::ostream &os)
 
static bool drawSVG (const ClusterGraphAttributes &A, const string &filename, const SVGSettings &settings=svgSettings)
 
static bool drawSVG (const ClusterGraphAttributes &A, std::ostream &os, const SVGSettings &settings)
 
static bool drawSVG (const ClusterGraphAttributes &A, std::ostream &os)
 
Utility functions for indentation

Text based write methods that use indentation for better readability of the produced text files apply a customizable indentation character and indentation width.

static char indentChar ()
 Returns the currently used indentation character. More...
 
static int indentWidth ()
 Returns the currently used indentation width. More...
 
static void setIndentChar (char c)
 Sets the indentation character to c. More...
 
static void setIndentWidth (int w)
 Sets the indentation width to w. More...
 
static std::ostream & indent (std::ostream &os, int depth)
 Prints indentation for indentation depth to output stream os and returns os. More...
 
Other utility functions
static bool setColorValue (int value, std::function< void(uint8_t)> setFunction)
 Set a color value (R/G/B/A) based on an integer. Checks if the value is in the right range. More...
 

Static Public Attributes

static Logger logger
 
static SVGSettings svgSettings
 

Static Private Attributes

static char s_indentChar
 Character used for indentation. More...
 
static int s_indentWidth
 Number of indent characters used for indentation. More...
 

Detailed Description

Utility class providing graph I/O in various exchange formats.

Definition at line 49 of file GraphIO.h.

Member Typedef Documentation

◆ AttrReaderFunc

using ogdf::GraphIO::AttrReaderFunc = bool (*)(GraphAttributes&, Graph&, std::istream&)

Type of simple graph attributes reader functions working on streams.

Definition at line 61 of file GraphIO.h.

◆ AttrWriterFunc

using ogdf::GraphIO::AttrWriterFunc = bool (*)(const GraphAttributes&, std::ostream&)

Type of simple graph attributes writer functions working on streams.

Definition at line 64 of file GraphIO.h.

◆ ReaderFunc

using ogdf::GraphIO::ReaderFunc = bool (*)(Graph&, std::istream&)

Type of simple graph reader functions working on streams.

Definition at line 55 of file GraphIO.h.

◆ WriterFunc

using ogdf::GraphIO::WriterFunc = bool (*)(const Graph&, std::ostream&)

Type of simple graph writer functions working on streams.

Definition at line 58 of file GraphIO.h.

Member Function Documentation

◆ drawSVG() [1/6]

static bool ogdf::GraphIO::drawSVG ( const GraphAttributes A,
const string &  filename,
const SVGSettings settings = svgSettings 
)
static
Deprecated:
"Streams should be used instead."

◆ drawSVG() [2/6]

static bool ogdf::GraphIO::drawSVG ( const GraphAttributes A,
std::ostream &  os,
const SVGSettings settings 
)
static

◆ drawSVG() [3/6]

static bool ogdf::GraphIO::drawSVG ( const GraphAttributes A,
std::ostream &  os 
)
inlinestatic

Definition at line 2668 of file GraphIO.h.

◆ drawSVG() [4/6]

static bool ogdf::GraphIO::drawSVG ( const ClusterGraphAttributes A,
const string &  filename,
const SVGSettings settings = svgSettings 
)
static
Deprecated:
"Streams should be used instead."

◆ drawSVG() [5/6]

static bool ogdf::GraphIO::drawSVG ( const ClusterGraphAttributes A,
std::ostream &  os,
const SVGSettings settings 
)
static

◆ drawSVG() [6/6]

static bool ogdf::GraphIO::drawSVG ( const ClusterGraphAttributes A,
std::ostream &  os 
)
inlinestatic

Definition at line 2675 of file GraphIO.h.

◆ indent()

static std::ostream& ogdf::GraphIO::indent ( std::ostream &  os,
int  depth 
)
static

Prints indentation for indentation depth to output stream os and returns os.

◆ indentChar()

static char ogdf::GraphIO::indentChar ( )
inlinestatic

Returns the currently used indentation character.

Definition at line 2688 of file GraphIO.h.

◆ indentWidth()

static int ogdf::GraphIO::indentWidth ( )
inlinestatic

Returns the currently used indentation width.

Definition at line 2691 of file GraphIO.h.

◆ read() [1/3]

static bool ogdf::GraphIO::read ( Graph G,
const string &  filename,
ReaderFunc  reader = GraphIO::read 
)
inlinestatic

Reads arbitrary format from a file specified by name.

Parameters
Ggraph to be read.
filenamename of the file to read from.
readerformat to be used (e.g. readGML), use read(Graph &G, std::istream &is) for automated detection
Returns
true if successful, false otherwise.

Definition at line 154 of file GraphIO.h.

◆ read() [2/3]

static bool ogdf::GraphIO::read ( Graph G,
std::istream &  is 
)
static

Reads graph G of arbitrary graph format from filename.

The following file formats are currently supported:

  • DOT
  • GML
  • TLP
  • LEDA
  • Chaco
  • DL
  • GDF
  • GraphML
  • GEXF
  • SteinLib
  • Graph6 (with enforced header)
Parameters
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ read() [3/3]

static bool ogdf::GraphIO::read ( GraphAttributes GA,
Graph G,
const string &  filename,
AttrReaderFunc  reader 
)
inlinestatic

Reads arbitrary format from a file specified by name.

Parameters
GAgraph attributes to be read.
Ggraph to be read.
filenamename of the file to read from.
readerformat to be used (e.g. readGML).
Returns
true if successful, false otherwise.

Definition at line 200 of file GraphIO.h.

◆ readBENCH() [1/2]

static bool ogdf::GraphIO::readBENCH ( Graph G,
List< node > &  hypernodes,
List< edge > *  shell,
const string &  filename 
)
static

Reads a hypergraph (as point-based expansion) in BENCH format from file filename.

A hypergraph in OGDF is represented by its point-based expansion, i.e., for each hyperedge h we have a corresponding hypernode n. All nodes originally incident to h are incident to n, i.e., have regular edges to n.

Warning
This is a very simple implementation only usable for very properly formatted files!
Parameters
Gis assigned the read graph (point-based expansion of the hypergraph).
hypernodesis assigned the list of nodes which have to be interpreted as hypernodes.
shellif 0 only the BENCH-hypergraph is read. Otherwise we extend the graph by a simple edge e=(i,o) and two hyperedges: one hyperedges groups all input nodes and i together, the other hyperedge groups all output edges and o. These additional edges are then also collocated in shell.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readBENCH() [2/2]

static bool ogdf::GraphIO::readBENCH ( Graph G,
List< node > &  hypernodes,
List< edge > *  shell,
std::istream &  is 
)
static

Reads a hypergraph (as point-based expansion) in BENCH format from input stream is.

A hypergraph in OGDF is represented by its point-based expansion, i.e., for each hyperedge h we have a corresponding hypernode n. All nodes originally incident to h are incident to n, i.e., have regular edges to n.

Warning
This is a very simple implementation only usable for very properly formatted files!
Parameters
Gis assigned the read graph (point-based expansion of the hypergraph).
hypernodesis assigned the list of nodes which have to be interpreted as hypernodes.
shellif 0 only the BENCH-hypergraph is read. Otherwise we extend the graph by a simple edge e=(i,o) and two hyperedges: one hyperedges groups all input nodes and i together, the other hyperedge groups all output edges and o. These additional edges are then also collocated in shell.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readChaco() [1/2]

static bool ogdf::GraphIO::readChaco ( Graph G,
const string &  filename 
)
static

Reads graph G in Chaco format from file filename.

See also
readChaco(Graph &G, std::istream &is) for more details.
writeChaco(const Graph &G, const string &filename)
Parameters
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readChaco() [2/2]

static bool ogdf::GraphIO::readChaco ( Graph G,
std::istream &  is 
)
static

Reads graph G in Chaco format from input stream is.

This simple graph format is used by graph partitioning tools like Chaco, Metis, or Jostle. Its specification is described in the Jostle User Guide.

See also
writeChaco(const Graph &G, std::ostream &os)
Parameters
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readChallengeGraph() [1/2]

static bool ogdf::GraphIO::readChallengeGraph ( Graph G,
GridLayout gl,
const string &  filename 
)
static

Reads graph G with grid layout gl in GD-Challenge-format from file filename.

Precondition
G is the graph associated with grid layout gl.
See also
writeChallengeGraph(const Graph &G, const GridLayout &gl, const string &filename)
Parameters
Gis assigned the read graph.
glis assigned the grid layout.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readChallengeGraph() [2/2]

static bool ogdf::GraphIO::readChallengeGraph ( Graph G,
GridLayout gl,
std::istream &  is 
)
static

Reads graph G with grid layout gl in GD-Challenge-format from input stream is.

Precondition
G is the graph associated with grid layout gl.
See also
writeChallengeGraph(const Graph &G, const GridLayout &gl, std::ostream &os)
Parameters
Gis assigned the read graph.
glis assigned the grid layout.
isis the input stream from which the graph is read.
Returns
true if successful, false otherwise.

◆ readDL() [1/4]

static bool ogdf::GraphIO::readDL ( Graph G,
const string &  filename 
)
static

Reads graph G in DL format from file filename.

See also
readDL(Graph &G, std::istream &is) for more details.
writeDL(const Graph &G, const string &filename)
Parameters
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readDL() [2/4]

static bool ogdf::GraphIO::readDL ( Graph G,
std::istream &  is 
)
static

Reads graph G in DL format from input stream is.

See also
writeDL(const Graph &G, std::ostream &os)
Parameters
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readDL() [3/4]

static bool ogdf::GraphIO::readDL ( GraphAttributes A,
Graph G,
const string &  filename 
)
static

Reads graph G with attributes A in DL format from file filename.

Precondition
G is the graph associated with attributes A.
See also
readDL(GraphAttributes &A, Graph &G, std::istream &is) for more details.
writeDL(const GraphAttributes &A, const string &filename)
Parameters
Ais assigned the graph's attributes.
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readDL() [4/4]

static bool ogdf::GraphIO::readDL ( GraphAttributes A,
Graph G,
std::istream &  is 
)
static

Reads graph G with attributes A in DL format from input stream is.

Precondition
G is the graph associated with attributes A.
See also
writeDL(const GraphAttributes &A, std::ostream &os)
Parameters
Ais assigned the graph's attributes.
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readDMF() [1/2]

template<typename T >
static bool ogdf::GraphIO::readDMF ( Graph graph,
EdgeArray< T > &  weights,
node source,
node sink,
const string &  filename 
)
inlinestatic

Reads a maximum flow instance in DIMACS format.

Parameters
graphwill contain the parsed graph
weightswill contain the weights of the edges
sourcewill contain the flow source
sinkwill contain the flow sink
filenamename of the file to be read
Returns
true iff the instances was parsed successfully
Deprecated:
"Streams should be used instead."

Definition at line 2375 of file GraphIO.h.

◆ readDMF() [2/2]

template<typename T >
static bool ogdf::GraphIO::readDMF ( Graph graph,
EdgeArray< T > &  weights,
node source,
node sink,
std::istream &  is 
)
inlinestatic

Reads a maximum flow instance in DIMACS format.

Parameters
graphwill contain the parsed graph
weightswill contain the weights of the edges
sourcewill contain the flow source
sinkwill contain the flow sink
isinput stream
Returns
true iff the instances was parsed successfully

Definition at line 2396 of file GraphIO.h.

◆ readDOT() [1/8]

static bool ogdf::GraphIO::readDOT ( Graph G,
const string &  filename 
)
static

Reads graph G in DOT format from file filename.

See also
readDOT(Graph &G, std::istream &is) for more details.
writeDOT(const Graph &G, const string &filename)
Parameters
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readDOT() [2/8]

static bool ogdf::GraphIO::readDOT ( Graph G,
std::istream &  is 
)
static

Reads graph G in DOT format from input stream is.

See also
writeDOT(const Graph &G, std::ostream &os)
Parameters
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readDOT() [3/8]

static bool ogdf::GraphIO::readDOT ( ClusterGraph C,
Graph G,
const string &  filename 
)
static

Reads clustered graph (C, G) in DOT format from file filename.

Precondition
G is the graph associated with clustered graph C.
See also
readDOT(ClusterGraph &C, Graph &G, std::istream &is) for more details.
writeDOT(const ClusterGraph &C, const string &filename)
Parameters
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readDOT() [4/8]

static bool ogdf::GraphIO::readDOT ( ClusterGraph C,
Graph G,
std::istream &  is 
)
static

Reads clustered graph (C, G) in DOT format from input stream is.

Precondition
G is the graph associated with clustered graph C.
See also
writeDOT(const ClusterGraph &C, std::ostream &os)
Parameters
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readDOT() [5/8]

static bool ogdf::GraphIO::readDOT ( GraphAttributes A,
Graph G,
const string &  filename 
)
static

Reads graph G with attributes A in DOT format from file filename.

Precondition
G is the graph associated with attributes A.
See also
readDOT(GraphAttributes &A, Graph &G, std::istream &is) for more details.
writeDOT(const GraphAttributes &A, const string &filename)
Parameters
Ais assigned the graph's attributes.
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readDOT() [6/8]

static bool ogdf::GraphIO::readDOT ( GraphAttributes A,
Graph G,
std::istream &  is 
)
static

Reads graph G with attributes A in DOT format from input stream is.

Precondition
G is the graph associated with attributes A.
See also
writeDOT(const GraphAttributes &A, std::ostream &os)
Parameters
Ais assigned the graph's attributes.
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readDOT() [7/8]

static bool ogdf::GraphIO::readDOT ( ClusterGraphAttributes A,
ClusterGraph C,
Graph G,
const string &  filename 
)
static

Reads clustered graph (C, G) with attributes A in DOT format from file filename.

Precondition
C is the clustered graph associated with attributes A, and G is the graph associated with C.
See also
readDOT(ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, std::istream &is) for more details.
writeDOT(const ClusterGraphAttributes &A, const string &filename)
Parameters
Ais assigned the graph's attributes.
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readDOT() [8/8]

static bool ogdf::GraphIO::readDOT ( ClusterGraphAttributes A,
ClusterGraph C,
Graph G,
std::istream &  is 
)
static

Reads clustered graph (C, G) with attributes A in DOT format from input stream is.

Precondition
C is the clustered graph associated with attributes A, and G is the graph associated with C.
See also
writeDOT(const ClusterGraphAttributes &A, std::ostream &os)
Parameters
Ais assigned the graph's attributes.
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readEdgeListSubgraph() [1/2]

static bool ogdf::GraphIO::readEdgeListSubgraph ( Graph G,
List< edge > &  delEdges,
const string &  filename 
)
static

Reads graph G with subgraph defined by delEdges from file filename.

See also
writeEdgeListSubgraph(const Graph &G, const List<edge> &delEdges, const string &filename)
Parameters
Gis assigned the read graph.
delEdgesis assigned the edges of the subgraph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readEdgeListSubgraph() [2/2]

static bool ogdf::GraphIO::readEdgeListSubgraph ( Graph G,
List< edge > &  delEdges,
std::istream &  is 
)
static

Reads graph G with subgraph defined by delEdges from stream is.

See also
writeEdgeListSubgraph(const Graph &G, const List<edge> &delEdges, std::ostream &os)
Parameters
Gis assigned the read graph.
delEdgesis assigned the edges of the subgraph.
isis the input stream from which the graph is read.
Returns
true if successful, false otherwise.

◆ readGDF() [1/4]

static bool ogdf::GraphIO::readGDF ( Graph G,
const string &  filename 
)
static

Reads graph G in GDF format from file filename.

See also
readGDF(Graph &G, std::istream &is) for more details.
writeGDF(const Graph &G, const string &filename)
Parameters
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readGDF() [2/4]

static bool ogdf::GraphIO::readGDF ( Graph G,
std::istream &  is 
)
static

Reads graph G in GDF format from input stream is.

See also
writeGDF(const Graph &G, std::ostream &os)
Parameters
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readGDF() [3/4]

static bool ogdf::GraphIO::readGDF ( GraphAttributes A,
Graph G,
const string &  filename 
)
static

Reads graph G with attributes A in GDF format from file filename.

Precondition
G is the graph associated with attributes A.
See also
readGDF(GraphAttributes &A, Graph &G, std::istream &is) for more details.
writeGDF(const GraphAttributes &A, const string &filename)
Parameters
Ais assigned the graph's attributes.
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readGDF() [4/4]

static bool ogdf::GraphIO::readGDF ( GraphAttributes A,
Graph G,
std::istream &  is 
)
static

Reads graph G with attributes A in GDF format from input stream is.

Precondition
G is the graph associated with attributes A.
See also
writeGDF(const GraphAttributes &A, std::ostream &os)
Parameters
Ais assigned the graph's attributes.
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readGEXF() [1/8]

static bool ogdf::GraphIO::readGEXF ( Graph G,
const string &  filename 
)
static

Reads graph G in GEXF format from file filename.

See also
readGEXF(Graph &G, std::istream &is) for more details.
writeGEXF(const Graph &G, const string &filename)
Parameters
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readGEXF() [2/8]

static bool ogdf::GraphIO::readGEXF ( Graph G,
std::istream &  is 
)
static

Reads graph G in GEXF format from input stream is.

See also
writeGEXF(const Graph &G, std::ostream &os)
Parameters
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readGEXF() [3/8]

static bool ogdf::GraphIO::readGEXF ( ClusterGraph C,
Graph G,
const string &  filename 
)
static

Reads clustered graph (C, G) in GEXF format from file filename.

Precondition
G is the graph associated with clustered graph C.
See also
readGEXF(ClusterGraph &C, Graph &G, std::istream &is) for more details.
writeGEXF(const ClusterGraph &C, const string &filename)
Parameters
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readGEXF() [4/8]

static bool ogdf::GraphIO::readGEXF ( ClusterGraph C,
Graph G,
std::istream &  is 
)
static

Reads clustered graph (C, G) in GEXF format from input stream is.

Precondition
G is the graph associated with clustered graph C.
See also
writeGEXF(const ClusterGraph &C, std::ostream &os)
Parameters
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readGEXF() [5/8]

static bool ogdf::GraphIO::readGEXF ( GraphAttributes A,
Graph G,
const string &  filename 
)
static

Reads graph G with attributes A in GEXF format from file filename.

Precondition
G is the graph associated with attributes A.
See also
readGEXF(GraphAttributes &A, Graph &G, std::istream &is) for more details.
writeGEXF(const GraphAttributes &A, const string &filename)
Parameters
Ais assigned the graph's attributes.
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readGEXF() [6/8]

static bool ogdf::GraphIO::readGEXF ( GraphAttributes A,
Graph G,
std::istream &  is 
)
static

Reads graph G with attributes A in GEXF format from input stream is.

Precondition
G is the graph associated with attributes A.
See also
writeGEXF(const GraphAttributes &A, std::ostream &os)
Parameters
Ais assigned the graph's attributes.
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readGEXF() [7/8]

static bool ogdf::GraphIO::readGEXF ( ClusterGraphAttributes A,
ClusterGraph C,
Graph G,
const string &  filename 
)
static

Reads clustered graph (C, G) with attributes A in GEXF format from file filename.

Precondition
C is the clustered graph associated with attributes A, and G is the graph associated with C.
See also
readGEXF(ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, std::istream &is) for more details.
writeGEXF(const ClusterGraphAttributes &A, const string &filename)
Parameters
Ais assigned the graph's attributes.
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readGEXF() [8/8]

static bool ogdf::GraphIO::readGEXF ( ClusterGraphAttributes A,
ClusterGraph C,
Graph G,
std::istream &  is 
)
static

Reads clustered graph (C, G) with attributes A in GEXF format from input stream is.

Precondition
C is the clustered graph associated with attributes A, and G is the graph associated with C.
See also
writeGEXF(const ClusterGraphAttributes &A, std::ostream &os)
Parameters
Ais assigned the graph's attributes.
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readGML() [1/8]

static bool ogdf::GraphIO::readGML ( Graph G,
const string &  filename 
)
static

Reads graph G in GML format from file filename.

See also
readGML(Graph &G, std::istream &is) for more details.
writeGML(const Graph &G, const string &filename)
Parameters
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readGML() [2/8]

static bool ogdf::GraphIO::readGML ( Graph G,
std::istream &  is 
)
static

Reads graph G in GML format from input stream is.

The GML (Graph Modelling Language) file format is an Ascii-based format that has been developed by Michael Himsolt at the University of Passau. Its full specification can be found in this technical report.

See also
writeGML(const Graph &G, std::ostream &os)
Parameters
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readGML() [3/8]

static bool ogdf::GraphIO::readGML ( ClusterGraph C,
Graph G,
const string &  filename 
)
static

Reads clustered graph (C, G) in GML format from file filename.

Precondition
G is the graph associated with clustered graph C.
See also
readGML(ClusterGraph &C, Graph &G, std::istream &is) for more details.
writeGML(const ClusterGraph &C, const string &filename)
Parameters
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readGML() [4/8]

static bool ogdf::GraphIO::readGML ( ClusterGraph C,
Graph G,
std::istream &  is 
)
static

Reads clustered graph (C, G) in GML format from input stream is.

Precondition
G is the graph associated with clustered graph C.
See also
writeGML(const ClusterGraph &C, std::ostream &os)
Parameters
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readGML() [5/8]

static bool ogdf::GraphIO::readGML ( ClusterGraphAttributes A,
ClusterGraph C,
Graph G,
const string &  filename 
)
static

Reads clustered graph (C, G) with attributes A in GML format from file filename.

Precondition
C is the clustered graph associated with attributes A, and G is the graph associated with C.
See also
readGML(ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, std::istream &is) for more details.
writeGML(const ClusterGraphAttributes &A, const string &filename)
Parameters
Ais assigned the graph's attributes.
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readGML() [6/8]

static bool ogdf::GraphIO::readGML ( ClusterGraphAttributes A,
ClusterGraph C,
Graph G,
std::istream &  is 
)
static

Reads clustered graph (C, G) with attributes A in GML format from input stream is.

Precondition
C is the clustered graph associated with attributes A, and G is the graph associated with C.
See also
writeGML(const ClusterGraphAttributes &A, std::ostream &os)
Parameters
Ais assigned the graph's attributes.
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readGML() [7/8]

static bool ogdf::GraphIO::readGML ( GraphAttributes A,
Graph G,
const string &  filename 
)
static

Reads graph G with attributes A in GML format from file filename.

Precondition
G is the graph associated with attributes A.
See also
readGML(GraphAttributes &A, Graph &G, std::istream &is) for more details.
writeGML(const GraphAttributes &A, const string &filename)
Parameters
Ais assigned the graph's attributes.
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readGML() [8/8]

static bool ogdf::GraphIO::readGML ( GraphAttributes A,
Graph G,
std::istream &  is 
)
static

Reads graph G with attributes A in GML format from input stream is.

Precondition
G is the graph associated with attributes A.
See also
writeGML(const GraphAttributes &A, std::ostream &os)
Parameters
Ais assigned the graph's attributes.
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readGraph6() [1/2]

static bool ogdf::GraphIO::readGraph6 ( Graph G,
const string &  filename,
bool  forceHeader = false 
)
static

Reads graph G in Graph6 format from file filename.

See also
readGraph6(Graph &G, std::istream &is) for more details.
writeGraph6(const Graph &G, const string &filename)
Parameters
Gis assigned the read graph.
filenameis the name of the file to be read.
forceHeaderif the file has to start with '>>graph6<<'.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readGraph6() [2/2]

static bool ogdf::GraphIO::readGraph6 ( Graph G,
std::istream &  is,
bool  forceHeader = false 
)
static

Reads graph G in Graph6 format from input stream is.

The Graph6 format represents an (preferable dense or small) simple undirected graph as a string containing printable characters between 0x3F and 0x7E. See the specification for more information.

See also
writeGraph6(const Graph &G, std::ostream &os)
Parameters
Gis assigned the read graph.
isis the input stream to be read.
forceHeaderif the file has to start with '>>graph6<<'.
Returns
true if successful, false otherwise.

◆ readGraphML() [1/8]

static bool ogdf::GraphIO::readGraphML ( Graph G,
const string &  filename 
)
static

Reads graph G in GraphML format from file filename.

See also
readGraphML(Graph &G, std::istream &is) for more details.
writeGraphML(const Graph &G, const string &filename)
Parameters
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readGraphML() [2/8]

static bool ogdf::GraphIO::readGraphML ( Graph G,
std::istream &  is 
)
static

Reads graph G in GraphML format from input stream is.

See also
writeGraphML(const Graph &G, std::ostream &os)
Parameters
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readGraphML() [3/8]

static bool ogdf::GraphIO::readGraphML ( ClusterGraph C,
Graph G,
const string &  filename 
)
static

Reads clustered graph (C, G) in GraphML format from file filename.

Precondition
G is the graph associated with clustered graph C.
See also
readGraphML(ClusterGraph &C, Graph &G, std::istream &is) for more details.
writeGraphML(const ClusterGraph &C, const string &filename)
Parameters
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readGraphML() [4/8]

static bool ogdf::GraphIO::readGraphML ( ClusterGraph C,
Graph G,
std::istream &  is 
)
static

Reads clustered graph (C, G) in GraphML format from input stream is.

Precondition
G is the graph associated with clustered graph C.
See also
writeGraphML(const ClusterGraph &C, std::ostream &os)
Parameters
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readGraphML() [5/8]

static bool ogdf::GraphIO::readGraphML ( GraphAttributes A,
Graph G,
const string &  filename 
)
static

Reads graph G with attributes A in GraphML format from file filename.

Precondition
G is the graph associated with attributes A.
See also
readGraphML(GraphAttributes &A, Graph &G, std::istream &is) for more details.
writeGraphML(const GraphAttributes &A, const string &filename)
Parameters
Ais assigned the graph's attributes.
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readGraphML() [6/8]

static bool ogdf::GraphIO::readGraphML ( GraphAttributes A,
Graph G,
std::istream &  is 
)
static

Reads graph G with attributes A in GraphML format from input stream is.

Precondition
G is the graph associated with attributes A.
See also
writeGraphML(const GraphAttributes &A, std::ostream &os)
Parameters
Ais assigned the graph's attributes.
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readGraphML() [7/8]

static bool ogdf::GraphIO::readGraphML ( ClusterGraphAttributes A,
ClusterGraph C,
Graph G,
const string &  filename 
)
static

Reads clustered graph (C, G) with attributes A in GraphML format from file filename.

Precondition
C is the clustered graph associated with attributes A, and G is the graph associated with C.
See also
readGraphML(ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, std::istream &is) for more details.
writeGraphML(const ClusterGraphAttributes &A, const string &filename)
Parameters
Ais assigned the graph's attributes.
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readGraphML() [8/8]

static bool ogdf::GraphIO::readGraphML ( ClusterGraphAttributes A,
ClusterGraph C,
Graph G,
std::istream &  is 
)
static

Reads clustered graph (C, G) with attributes A in GraphML format from input stream is.

Precondition
C is the clustered graph associated with attributes A, and G is the graph associated with C.
See also
writeGraphML(const ClusterGraphAttributes &A, std::ostream &os)
Parameters
Ais assigned the graph's attributes.
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readLEDA() [1/2]

static bool ogdf::GraphIO::readLEDA ( Graph G,
const string &  filename 
)
static

Reads graph G in LEDA graph format from file filename.

See also
readLEDA(Graph &G, std::istream &is) for more details.
writeLEDA(const Graph &G, const string &filename)
Parameters
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readLEDA() [2/2]

static bool ogdf::GraphIO::readLEDA ( Graph G,
std::istream &  is 
)
static

Reads graph G in LEDA graph format from input stream is.

The LEDA graph format is a simple, Ascii-based file format used by the LEDA library. Its specification is described in the LEDA Guide.

See also
writeLEDA(const Graph &G, std::ostream &os)
Parameters
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readMatrixMarket() [1/2]

static bool ogdf::GraphIO::readMatrixMarket ( Graph G,
std::istream &  inStream 
)
static

Reads graph G in Matrix Market exchange format from stream inStream.

Parameters
Gis assigned the read graph.
inStreamis the input stream to read from
Returns
true if successful, false otherwise.

◆ readMatrixMarket() [2/2]

static bool ogdf::GraphIO::readMatrixMarket ( Graph G,
const string &  filename 
)
static

Reads graph G in Matrix Market exchange format from a file with the given filename.

Parameters
Gis assigned the read graph.
filenameis the path to the input file to read from
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readPLA() [1/2]

static bool ogdf::GraphIO::readPLA ( Graph G,
List< node > &  hypernodes,
List< edge > *  shell,
const string &  filename 
)
static

Reads a hypergraph (as point-based expansion) in PLA format from file filename.

Parameters
Gis assigned the read graph (point-based expansion of the hypergraph).
hypernodesis assigned the list of nodes which have to be interpreted as hypernodes.
shellif 0 only the PLA-hypergraph is read. Otherwise we extend the graph by a simple edge e=(i,o) and two hyperedges: one hyperedges groups all input nodes and i together, the other hyperedge groups all output edges and o. These additional edges are then also collocated in shell.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
See also
readPLA(Graph &G, List<node>& hypernodes, List<edge> *shell, std::istream &is) for details
Deprecated:
"Streams should be used instead."

◆ readPLA() [2/2]

static bool ogdf::GraphIO::readPLA ( Graph G,
List< node > &  hypernodes,
List< edge > *  shell,
std::istream &  is 
)
static

Reads a hypergraph (as point-based expansion) in PLA format from input stream is.

A hypergraph in OGDF is represented by its point-based expansion, i.e., for each hyperedge h we have a corresponding hypernode n. All nodes originally incident to h are incident to n, i.e., have regular edges to n.

Warning
This is a very simple implementation only usable for very properly formatted files!
Parameters
Gis assigned the read graph (point-based expansion of the hypergraph).
hypernodesis assigned the list of nodes which have to be interpreted as hypernodes.
shellif 0 only the PLA-hypergraph is read. Otherwise we extend the graph by a simple edge e=(i,o) and two hyperedges: one hyperedges groups all input nodes and i together, the other hyperedge groups all output edges and o. These additional edges are then also collocated in shell.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readPMDissGraph() [1/2]

static bool ogdf::GraphIO::readPMDissGraph ( Graph G,
const string &  filename 
)
static

Reads graph G in a simple format as used in Petra Mutzel's thesis from file filename.

See also
readPMDissGraph(Graph &G, std::istream &is) for more details.
writePMDissGraph(const Graph &G, const string &filename)
Parameters
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readPMDissGraph() [2/2]

static bool ogdf::GraphIO::readPMDissGraph ( Graph G,
std::istream &  is 
)
static

Reads graph G in a simple format as used in Petra Mutzel's thesis from input stream is.

This simple graph format has a leading line stating the name of the graph and a following line stating the size of the graph:

*BEGIN unknown_name.numN.numE
*GRAPH numN numE UNDIRECTED UNWEIGHTED
See also
writePMDissGraph(const Graph &G, std::ostream &os)
Parameters
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readRome() [1/2]

static bool ogdf::GraphIO::readRome ( Graph G,
const string &  filename 
)
static

Reads graph G in Rome-Lib format from file filename.

See also
readRome(Graph &G, std::istream &is) for more details.
writeRome(const Graph &G, const string &filename)
Parameters
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readRome() [2/2]

static bool ogdf::GraphIO::readRome ( Graph G,
std::istream &  is 
)
static

Reads graph G in Rome-Lib format from input stream is.

The Rome-Lib format contains n "node-lines", 1 "separator-line", m "edge-lines" (in this order). These lines are as follows (whereby all IDs are integer numbers):

  • node-line: NodeId 0
  • separator-line: starts with a #-sign
  • edge-line: EdgeId 0 SourceNodeId TargetNodeId
See also
writeRome(const Graph &G, std::ostream &os)
Parameters
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readRudy() [1/2]

static bool ogdf::GraphIO::readRudy ( GraphAttributes A,
Graph G,
const string &  filename 
)
static

Reads graph G with edge weights stored in A in Rudy format from file filename.

Precondition
G is the graph associated with attributes A.
See also
readRudy(GraphAttributes &A, Graph &G, std::istream &is) for more details.
writeRudy(const GraphAttributes &A, const string &filename)
Parameters
Ais assigned the graph's attributes (only edge weights (as doubles) are used).
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readRudy() [2/2]

static bool ogdf::GraphIO::readRudy ( GraphAttributes A,
Graph G,
std::istream &  is 
)
static

Reads graph G with edge weights stored in A in Rudy format from input stream is.

Precondition
G is the graph associated with attributes A.
See also
writeRudy(const GraphAttributes &A, std::ostream &os)
Parameters
Ais assigned the graph's attributes (only edge weights (as doubles) are used).
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readSTP() [1/3]

static bool ogdf::GraphIO::readSTP ( Graph G,
std::istream &  is 
)
inlinestatic

Reads a graph in SteinLib format from std::istream is.

Warning
The coordinate section, weights and terminals of the SteinLib instance is not read!
Parameters
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

Definition at line 2054 of file GraphIO.h.

◆ readSTP() [2/3]

template<typename T >
static bool ogdf::GraphIO::readSTP ( EdgeWeightedGraph< T > &  wG,
List< node > &  terminals,
NodeArray< bool > &  isTerminal,
const string &  filename 
)
inlinestatic

Reads a SteinLib instance from file filename and converts it into a weighted graph wG and a set of terminal nodes terminals.

Warning
The coordinate section of the SteinLib instance is not read!
Parameters
wGthe edge weighteed graph
terminalswill contain a list of all terminals in the graph
isTerminalmaps whether each node is a terminal or a Steiner node
filenamethe name of the file to be read
Returns
true if the STP was read successfully, false otherwise
Deprecated:
"Streams should be used instead."

Definition at line 2077 of file GraphIO.h.

◆ readSTP() [3/3]

template<typename T >
static bool ogdf::GraphIO::readSTP ( EdgeWeightedGraph< T > &  wG,
List< node > &  terminals,
NodeArray< bool > &  isTerminal,
std::istream &  is 
)
inlinestatic

Reads a SteinLib instance from an inputstream is and converts it into a weighted graph wG and a set of terminal nodes terminals.

Warning
The coordinate section of the SteinLib instance is not read!
Parameters
wGthe edge weighteed graph
terminalswill contain a list of all terminals in the graph
isTerminalmaps whether each node is a terminal or a Steiner node
isthe input stream to be read
Returns
true if the STP was read successfully, false otherwise

Definition at line 2099 of file GraphIO.h.

◆ readTLP() [1/8]

static bool ogdf::GraphIO::readTLP ( Graph G,
const string &  filename 
)
static

Reads graph G in TLP format from file filename.

See also
readTLP(Graph &G, std::istream &is) for more details.
writeTLP(const Graph &G, const string &filename)
Parameters
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readTLP() [2/8]

static bool ogdf::GraphIO::readTLP ( Graph G,
std::istream &  is 
)
static

Reads graph G in TLP format from input stream is.

See also
writeTLP(const Graph &G, std::ostream &os)
Parameters
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readTLP() [3/8]

static bool ogdf::GraphIO::readTLP ( ClusterGraph C,
Graph G,
const string &  filename 
)
static

Reads clustered graph (C, G) in TLP format from file filename.

Precondition
G is the graph associated with clustered graph C.
See also
readTLP(ClusterGraph &C, Graph &G, std::istream &is) for more details.
writeTLP(const ClusterGraph &C, const string &filename)
Parameters
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readTLP() [4/8]

static bool ogdf::GraphIO::readTLP ( ClusterGraph C,
Graph G,
std::istream &  is 
)
static

Reads clustered graph (C, G) in TLP format from input stream is.

Precondition
G is the graph associated with clustered graph C.
See also
writeTLP(const ClusterGraph &C, std::ostream &os)
Parameters
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readTLP() [5/8]

static bool ogdf::GraphIO::readTLP ( GraphAttributes A,
Graph G,
const string &  filename 
)
static

Reads graph G with attributes A in TLP format from file filename.

Precondition
G is the graph associated with attributes A.
See also
readTLP(GraphAttributes &A, Graph &G, std::istream &is) for more details.
writeTLP(const GraphAttributes &A, const string &filename)
Parameters
Ais assigned the graph's attributes.
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readTLP() [6/8]

static bool ogdf::GraphIO::readTLP ( GraphAttributes A,
Graph G,
std::istream &  is 
)
static

Reads graph G with attributes A in TLP format from input stream is.

Precondition
G is the graph associated with attributes A.
See also
writeTLP(const GraphAttributes &A, std::ostream &os)
Parameters
Ais assigned the graph's attributes.
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readTLP() [7/8]

static bool ogdf::GraphIO::readTLP ( ClusterGraphAttributes A,
ClusterGraph C,
Graph G,
const string &  filename 
)
static

Reads clustered graph (C, G) with attributes A in TLP format from file filename.

Precondition
C is the clustered graph associated with attributes A, and G is the graph associated with C.
See also
readTLP(ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, std::istream &is) for more details.
writeTLP(const ClusterGraphAttributes &A, const string &filename)
Parameters
Ais assigned the graph's attributes.
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readTLP() [8/8]

static bool ogdf::GraphIO::readTLP ( ClusterGraphAttributes A,
ClusterGraph C,
Graph G,
std::istream &  is 
)
static

Reads clustered graph (C, G) with attributes A in TLP format from input stream is.

Precondition
C is the clustered graph associated with attributes A, and G is the graph associated with C.
See also
writeTLP(const ClusterGraphAttributes &A, std::ostream &os)
Parameters
Ais assigned the graph's attributes.
Cis assigned the read clustered graph (cluster structure).
Gis assigned the read clustered graph (graph structure).
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ readYGraph() [1/2]

static bool ogdf::GraphIO::readYGraph ( Graph G,
const string &  filename 
)
static

Reads graph G in Y-graph format from file filename.

See also
readYGraph(Graph &G, std::istream &is) for more details.
Parameters
Gis assigned the read graph.
filenameis the name of the file to be read.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ readYGraph() [2/2]

static bool ogdf::GraphIO::readYGraph ( Graph G,
std::istream &  is 
)
static

Reads graph G in Y-graph format from input stream is.

This format is e.g. produced by NAUTY (http://www.cs.sunysb.edu/~algorith/implement/nauty/implement.shtml).

Details on the format, as given in NAUTYs graph generator (see above link): "[A] graph occupies one line with a terminating newline. Except for the newline, each byte has the format 01xxxxxx, where each "x" represents one bit of data.

First byte: xxxxxx is the number of vertices n

Other ceiling(n(n-1)/12) bytes: These contain the upper triangle of the adjacency matrix in column major order. That is, the entries appear in the order (0,1),(0,2),(1,2),(0,3),(1,3),(2,3),(0,4),... . The bits are used in left to right order within each byte. Any unused bits on the end are set to zero.

Parameters
Gis assigned the read graph.
isis the input stream to be read.
Returns
true if successful, false otherwise.

◆ setColorValue()

static bool ogdf::GraphIO::setColorValue ( int  value,
std::function< void(uint8_t)>  setFunction 
)
inlinestatic

Set a color value (R/G/B/A) based on an integer. Checks if the value is in the right range.

Definition at line 2720 of file GraphIO.h.

◆ setIndentChar()

static void ogdf::GraphIO::setIndentChar ( char  c)
inlinestatic

Sets the indentation character to c.

Precondition
c must be a white-space character (e.g., a space or a tab).

Definition at line 2697 of file GraphIO.h.

◆ setIndentWidth()

static void ogdf::GraphIO::setIndentWidth ( int  w)
inlinestatic

Sets the indentation width to w.

Precondition
w must be non-negative. Setting the indentation width to 0 suppresses indentation.

Definition at line 2707 of file GraphIO.h.

◆ write() [1/2]

static bool ogdf::GraphIO::write ( const Graph G,
const string &  filename,
WriterFunc  writer 
)
inlinestatic

Writes arbitrary format to a file specified by name.

Parameters
Ggraph to be written.
filenamename of the file to write to.
writerformat to be used (e.g. writeGML)
Returns
true if successful, false otherwise.

Definition at line 166 of file GraphIO.h.

◆ write() [2/2]

static bool ogdf::GraphIO::write ( const GraphAttributes GA,
const string &  filename,
AttrWriterFunc  writer 
)
inlinestatic

Writes arbitrary format to a file specified by name.

Parameters
GAgraph attributes to be written.
filenamename of the file to write to.
writerformat to be used (e.g. writeGML).
Returns
true if successful, false otherwise.

Definition at line 212 of file GraphIO.h.

◆ writeChaco() [1/2]

static bool ogdf::GraphIO::writeChaco ( const Graph G,
const string &  filename 
)
static

Writes graph G in Chaco format to file filename.

See also
writeChaco(const Graph &G, std::ostream &os) for more details.
readChaco(Graph &G, const string &filename)
Parameters
Gis the graph to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeChaco() [2/2]

static bool ogdf::GraphIO::writeChaco ( const Graph G,
std::ostream &  os 
)
static

Writes graph G in Chaco format to output stream os.

This simple graph format is used by graph partitioning tools like Chaco, Metis, or Jostle. Its specification is described in the Jostle User Guide.

See also
readChaco(Graph &G, std::istream &is)
Parameters
Gis the graph to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeChallengeGraph() [1/2]

static bool ogdf::GraphIO::writeChallengeGraph ( const Graph G,
const GridLayout gl,
const string &  filename 
)
static

Writes graph G with grid layout gl in GD-Challenge-format to file filename.

Precondition
G is the graph associated with grid layout gl.
See also
readChallengeGraph(Graph &G, GridLayout &gl, const string &filename)
Parameters
Gis the graph to be written.
glspecifies the grid layout of G to be written.
filenameis the name of the file to which the clustered graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeChallengeGraph() [2/2]

static bool ogdf::GraphIO::writeChallengeGraph ( const Graph G,
const GridLayout gl,
std::ostream &  os 
)
static

Writes graph G with grid layout gl in GD-Challenge-format to output stream os.

Precondition
G is the graph associated with grid layout gl.
See also
readChallengeGraph(Graph &G, GridLayout &gl, std::istream &is)
Parameters
Gis the graph to be written.
glspecifies the grid layout of G to be written.
osis the output stream to which the graph is written.
Returns
true if successful, false otherwise.

◆ writeDL() [1/4]

static bool ogdf::GraphIO::writeDL ( const Graph G,
const string &  filename 
)
static

Writes graph G in DL format to file filename.

See also
writeDL(const Graph &G, std::ostream &os) for more details.
readDL(Graph &G, const string &filename)
Parameters
Gis the graph to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeDL() [2/4]

static bool ogdf::GraphIO::writeDL ( const Graph G,
std::ostream &  os 
)
static

Writes graph G in DL format to output stream os.

Parameters
Gis the graph to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeDL() [3/4]

static bool ogdf::GraphIO::writeDL ( const GraphAttributes A,
const string &  filename 
)
static

Writes graph with attributes A in DL format to file filename.

See also
writeDL(const GraphAttributes &A, std::ostream &os) for more details.
readDL(GraphAttributes &A, Graph &G, const string &filename)
Parameters
Aspecifies the graph and its attributes to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeDL() [4/4]

static bool ogdf::GraphIO::writeDL ( const GraphAttributes A,
std::ostream &  os 
)
static

Writes graph with attributes A in DL format to output stream os.

Parameters
Aspecifies the graph and its attributes to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeDMF() [1/2]

template<typename T >
static bool ogdf::GraphIO::writeDMF ( const Graph graph,
const EdgeArray< T > &  weights,
const node  source,
const node  sink,
const string &  filename 
)
inlinestatic

Writes a maximum flow problem instance to a DIMACS maximum flow file.

Parameters
graphgraph to be written
weightswill contain the weights of the edges
sourcesource of the maximum flow
sinksink of the maximum flow
filenamename of the file to be written to
Returns
true if the write operation succeeded, false otherwise
Deprecated:
"Streams should be used instead."

Definition at line 2554 of file GraphIO.h.

◆ writeDMF() [2/2]

template<typename T >
static bool ogdf::GraphIO::writeDMF ( const Graph graph,
const EdgeArray< T > &  weights,
const node  source,
const node  sink,
std::ostream &  os 
)
inlinestatic

Writes a maximum flow problem instance to a DIMACS maximum flow file.

Parameters
graphgraph to be written
weightswill contain the weights of the edges
sourcesource of the maximum flow
sinksink of the maximum flow
osthe output stream be written to
Returns
true if the write operation succeeded, false otherwise

Definition at line 2577 of file GraphIO.h.

◆ writeDOT() [1/8]

static bool ogdf::GraphIO::writeDOT ( const Graph G,
const string &  filename 
)
static

Writes graph G in DOT format to file filename.

See also
writeDOT(const Graph &G, std::ostream &os) for more details.
readDOT(Graph &G, const string &filename)
Parameters
Gis the graph to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeDOT() [2/8]

static bool ogdf::GraphIO::writeDOT ( const Graph G,
std::ostream &  os 
)
static

Writes graph G in DOT format to output stream os.

Parameters
Gis the graph to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeDOT() [3/8]

static bool ogdf::GraphIO::writeDOT ( const ClusterGraph C,
const string &  filename 
)
static

Writes clustered graph C in DOT format to file filename.

See also
writeDOT(const ClusterGraph &C, std::ostream &os) for more details.
readDOT(ClusterGraph &C, Graph &G, const string &filename)
Parameters
Cis the clustered graph to be written.
filenameis the name of the file to which the clustered graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeDOT() [4/8]

static bool ogdf::GraphIO::writeDOT ( const ClusterGraph C,
std::ostream &  os 
)
static

Writes clustered graph C in DOT format to output stream os.

Parameters
Cis the clustered graph to be written.
osis the output stream to which the clustered graph will be written.
Returns
true if successful, false otherwise.

◆ writeDOT() [5/8]

static bool ogdf::GraphIO::writeDOT ( const GraphAttributes A,
const string &  filename 
)
static

Writes graph with attributes A in DOT format to file filename.

See also
writeDOT(const GraphAttributes &A, std::ostream &os) for more details.
readDOT(GraphAttributes &A, Graph &G, const string &filename)
Parameters
Aspecifies the graph and its attributes to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeDOT() [6/8]

static bool ogdf::GraphIO::writeDOT ( const GraphAttributes A,
std::ostream &  os 
)
static

Writes graph with attributes A in DOT format to output stream os.

Parameters
Aspecifies the graph and its attributes to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeDOT() [7/8]

static bool ogdf::GraphIO::writeDOT ( const ClusterGraphAttributes A,
const string &  filename 
)
static

Writes graph with attributes A in DOT format to file filename.

See also
writeDOT(const ClusterGraphAttributes &A, std::ostream &os) for more details.
readDOT(ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, const string &filename)
Parameters
Aspecifies the clustered graph and its attributes to be written.
filenameis the name of the file to which the clustered graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeDOT() [8/8]

static bool ogdf::GraphIO::writeDOT ( const ClusterGraphAttributes A,
std::ostream &  os 
)
static

Writes graph with attributes A in DOT format to output stream os.

Parameters
Aspecifies the clustered graph and its attributes to be written.
osis the output stream to which the clustered graph will be written.
Returns
true if successful, false otherwise.

◆ writeEdgeListSubgraph() [1/2]

static bool ogdf::GraphIO::writeEdgeListSubgraph ( const Graph G,
const List< edge > &  delEdges,
const string &  filename 
)
static

Writes graph G with subgraph defined by delEdges to file filename.

See also
readEdgeListSubgraph(Graph &G, List<edge> &delEdges, const string &filename)
Parameters
Gis the graph to be written.
delEdgesspecifies the edges of the subgraph to be stored.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeEdgeListSubgraph() [2/2]

static bool ogdf::GraphIO::writeEdgeListSubgraph ( const Graph G,
const List< edge > &  delEdges,
std::ostream &  os 
)
static

Writes graph G with subgraph defined by delEdges to stream os.

See also
readEdgeListSubgraph(Graph &G, List<edge> &delEdges, std::istream &is)
Parameters
Gis the graph to be written.
delEdgesspecifies the edges of the subgraph to be stored.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeGDF() [1/4]

static bool ogdf::GraphIO::writeGDF ( const Graph G,
const string &  filename 
)
static

Writes graph G in GDF format to file filename.

See also
writeGDF(const Graph &G, std::ostream &os) for more details.
readGDF(Graph &G, const string &filename)
Parameters
Gis the graph to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeGDF() [2/4]

static bool ogdf::GraphIO::writeGDF ( const Graph G,
std::ostream &  os 
)
static

Writes graph G in GDF format to output stream os.

Parameters
Gis the graph to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeGDF() [3/4]

static bool ogdf::GraphIO::writeGDF ( const GraphAttributes A,
const string &  filename 
)
static

Writes graph with attributes A in GDF format to file filename.

See also
writeGDF(const GraphAttributes &A, std::ostream &os) for more details.
readGDF(GraphAttributes &A, Graph &G, const string &filename)
Parameters
Aspecifies the graph and its attributes to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeGDF() [4/4]

static bool ogdf::GraphIO::writeGDF ( const GraphAttributes A,
std::ostream &  os 
)
static

Writes graph with attributes A in GDF format to output stream os.

Parameters
Aspecifies the graph and its attributes to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeGEXF() [1/8]

static bool ogdf::GraphIO::writeGEXF ( const Graph G,
const string &  filename 
)
static

Writes graph G in GEXF format to file filename.

See also
writeGEXF(const Graph &G, std::ostream &os) for more details.
readGEXF(Graph &G, const string &filename)
Parameters
Gis the graph to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeGEXF() [2/8]

static bool ogdf::GraphIO::writeGEXF ( const Graph G,
std::ostream &  os 
)
static

Writes graph G in GEXF format to output stream os.

Parameters
Gis the graph to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeGEXF() [3/8]

static bool ogdf::GraphIO::writeGEXF ( const ClusterGraph C,
const string &  filename 
)
static

Writes clustered graph C in GEXF format to file filename.

See also
writeGEXF(const ClusterGraph &C, std::ostream &os) for more details.
readGEXF(ClusterGraph &C, Graph &G, const string &filename)
Parameters
Cis the clustered graph to be written.
filenameis the name of the file to which the clustered graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeGEXF() [4/8]

static bool ogdf::GraphIO::writeGEXF ( const ClusterGraph C,
std::ostream &  os 
)
static

Writes clustered graph C in GEXF format to output stream os.

Parameters
Cis the clustered graph to be written.
osis the output stream to which the clustered graph will be written.
Returns
true if successful, false otherwise.

◆ writeGEXF() [5/8]

static bool ogdf::GraphIO::writeGEXF ( const GraphAttributes A,
const string &  filename 
)
static

Writes graph with attributes A in GEXF format to file filename.

See also
writeGEXF(const GraphAttributes &A, std::ostream &os) for more details.
readGEXF(GraphAttributes &A, Graph &G, const string &filename)
Parameters
Aspecifies the graph and its attributes to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeGEXF() [6/8]

static bool ogdf::GraphIO::writeGEXF ( const GraphAttributes A,
std::ostream &  os 
)
static

Writes graph with attributes A in GEXF format to output stream os.

Parameters
Aspecifies the graph and its attributes to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeGEXF() [7/8]

static bool ogdf::GraphIO::writeGEXF ( const ClusterGraphAttributes A,
const string &  filename 
)
static

Writes graph with attributes A in GEXF format to file filename.

See also
writeGEXF(const ClusterGraphAttributes &A, std::ostream &os) for more details.
readGEXF(ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, const string &filename)
Parameters
Aspecifies the clustered graph and its attributes to be written.
filenameis the name of the file to which the clustered graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeGEXF() [8/8]

static bool ogdf::GraphIO::writeGEXF ( const ClusterGraphAttributes A,
std::ostream &  os 
)
static

Writes graph with attributes A in GEXF format to output stream os.

Parameters
Aspecifies the clustered graph and its attributes to be written.
osis the output stream to which the clustered graph will be written.
Returns
true if successful, false otherwise.

◆ writeGML() [1/8]

static bool ogdf::GraphIO::writeGML ( const Graph G,
const string &  filename 
)
static

Writes graph G in GML format to file filename.

See also
writeGML(const Graph &G, std::ostream &os) for more details.
readGML(Graph &G, const string &filename)
Parameters
Gis the graph to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeGML() [2/8]

static bool ogdf::GraphIO::writeGML ( const Graph G,
std::ostream &  os 
)
static

Writes graph G in GML format to output stream os.

The GML (Graph Modelling Language) file format is an Ascii-based format that has been developed by Michael Himsolt at the University of Passau. Its full specification can be found in this technical report. The GML format stores the basic graph structure, i.e., nodes and edges.

See also
readGML(Graph &G, std::istream &is)
Parameters
Gis the graph to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeGML() [3/8]

static bool ogdf::GraphIO::writeGML ( const ClusterGraph C,
const string &  filename 
)
static

Writes clustered graph C in GML format to file filename.

See also
writeGML(const ClusterGraph &C, std::ostream &os) for more details.
readGML(ClusterGraph &C, Graph &G, const string &filename)
Parameters
Cis the clustered graph to be written.
filenameis the name of the file to which the clustered graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeGML() [4/8]

static bool ogdf::GraphIO::writeGML ( const ClusterGraph C,
std::ostream &  os 
)
static

Writes clustered graph C in GML format to output stream os.

See also
readGML(ClusterGraph &C, Graph &G, std::istream &is)
Parameters
Cis the clustered graph to be written.
osis the output stream to which the clustered graph will be written.
Returns
true if successful, false otherwise.

◆ writeGML() [5/8]

static bool ogdf::GraphIO::writeGML ( const ClusterGraphAttributes A,
const string &  filename 
)
static

Writes graph with attributes A in GML format to file filename.

See also
writeGML(const ClusterGraphAttributes &A, std::ostream &os) for more details.
readGML(ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, const string &filename)
Parameters
Aspecifies the clustered graph and its attributes to be written.
filenameis the name of the file to which the clustered graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeGML() [6/8]

static bool ogdf::GraphIO::writeGML ( const ClusterGraphAttributes A,
std::ostream &  os 
)
static

Writes graph with attributes A in GML format to output stream os.

See also
readGML(ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, std::istream &is)
Parameters
Aspecifies the clustered graph and its attributes to be written.
osis the output stream to which the clustered graph will be written.
Returns
true if successful, false otherwise.

◆ writeGML() [7/8]

static bool ogdf::GraphIO::writeGML ( const GraphAttributes A,
const string &  filename 
)
static

Writes graph with attributes A in GML format to file filename.

See also
writeGML(const GraphAttributes &A, std::ostream &os) for more details.
readGML(GraphAttributes &A, Graph &G, const string &filename)
Parameters
Aspecifies the graph and its attributes to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeGML() [8/8]

static bool ogdf::GraphIO::writeGML ( const GraphAttributes A,
std::ostream &  os 
)
static

Writes graph with attributes A in GML format to output stream os.

See also
readGML(GraphAttributes &A, Graph &G, std::istream &is)
Parameters
Aspecifies the graph and its attributes to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeGraph6() [1/2]

static bool ogdf::GraphIO::writeGraph6 ( const Graph G,
const string &  filename 
)
static

Writes graph G in Graph6 format to file filename.

See also
writeGraph6(const Graph &G, std::ostream &os) for more details.
readGraph6(Graph &G, const string &filename)
Parameters
Gis the graph to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeGraph6() [2/2]

static bool ogdf::GraphIO::writeGraph6 ( const Graph G,
std::ostream &  os 
)
static

Writes graph G in Graph6 format to output stream os.

See also
readGraph6(Graph &G, std::istream &is)
Parameters
Gis the graph to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeGraphML() [1/8]

static bool ogdf::GraphIO::writeGraphML ( const Graph G,
const string &  filename 
)
static

Writes graph G in GraphML format to file filename.

See also
writeGraphML(const Graph &G, std::ostream &os) for more details.
readGraphML(Graph &G, const string &filename)
Parameters
Gis the graph to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeGraphML() [2/8]

static bool ogdf::GraphIO::writeGraphML ( const Graph G,
std::ostream &  os 
)
static

Writes graph G in GraphML format to output stream os.

Parameters
Gis the graph to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeGraphML() [3/8]

static bool ogdf::GraphIO::writeGraphML ( const ClusterGraph C,
const string &  filename 
)
static

Writes clustered graph C in GraphML format to file filename.

See also
writeGraphML(const ClusterGraph &C, std::ostream &os) for more details.
readGraphML(ClusterGraph &C, Graph &G, const string &filename)
Parameters
Cis the clustered graph to be written.
filenameis the name of the file to which the clustered graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeGraphML() [4/8]

static bool ogdf::GraphIO::writeGraphML ( const ClusterGraph C,
std::ostream &  os 
)
static

Writes clustered graph C in GraphML format to output stream os.

Parameters
Cis the clustered graph to be written.
osis the output stream to which the clustered graph will be written.
Returns
true if successful, false otherwise.

◆ writeGraphML() [5/8]

static bool ogdf::GraphIO::writeGraphML ( const GraphAttributes A,
const string &  filename 
)
static

Writes graph with attributes A in GraphML format to file filename.

See also
writeGraphML(const GraphAttributes &A, std::ostream &os) for more details.
readGraphML(GraphAttributes &A, Graph &G, const string &filename)
Parameters
Aspecifies the graph and its attributes to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeGraphML() [6/8]

static bool ogdf::GraphIO::writeGraphML ( const GraphAttributes A,
std::ostream &  os 
)
static

Writes graph with attributes A in GraphML format to output stream os.

Parameters
Aspecifies the graph and its attributes to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeGraphML() [7/8]

static bool ogdf::GraphIO::writeGraphML ( const ClusterGraphAttributes A,
const string &  filename 
)
static

Writes graph with attributes A in GraphML format to file filename.

See also
writeGraphML(const ClusterGraphAttributes &A, std::ostream &os) for more details.
readGraphML(ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, const string &filename)
Parameters
Aspecifies the clustered graph and its attributes to be written.
filenameis the name of the file to which the clustered graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeGraphML() [8/8]

static bool ogdf::GraphIO::writeGraphML ( const ClusterGraphAttributes A,
std::ostream &  os 
)
static

Writes graph with attributes A in GraphML format to output stream os.

Parameters
Aspecifies the clustered graph and its attributes to be written.
osis the output stream to which the clustered graph will be written.
Returns
true if successful, false otherwise.

◆ writeLEDA() [1/2]

static bool ogdf::GraphIO::writeLEDA ( const Graph G,
const string &  filename 
)
static

Writes graph G in LEDA graph format to file filename.

See also
writeLEDA(const Graph &G, std::ostream &os) for more details.
readLEDA(Graph &G, const string &filename)
Parameters
Gis the graph to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeLEDA() [2/2]

static bool ogdf::GraphIO::writeLEDA ( const Graph G,
std::ostream &  os 
)
static

Writes graph G in LEDA graph format to output stream os.

The LEDA graph format is a simple, Ascii-based file format used by the LEDA library. Its specification is described in the LEDA Guide.

See also
readLEDA(Graph &G, std::istream &is)
Parameters
Gis the graph to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writePMDissGraph() [1/2]

static bool ogdf::GraphIO::writePMDissGraph ( const Graph G,
const string &  filename 
)
static

Writes graph G in a simple format as used in Petra Mutzel's thesis to file filename.

See also
writePMDissGraph(const Graph &G, std::ostream &os) for more details.
readPMDissGraph(Graph &G, const string &filename)
Parameters
Gis the graph to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writePMDissGraph() [2/2]

static bool ogdf::GraphIO::writePMDissGraph ( const Graph G,
std::ostream &  os 
)
static

Writes graph G in a simple format as used in Petra Mutzel's thesis to output stream os.

This simple graph format has a leading line stating the name of the graph and a following line stating the size of the graph:

*BEGIN unknown_name.numN.numE
*GRAPH numN numE UNDIRECTED UNWEIGHTED
See also
readPMDissGraph(Graph &G, std::istream &is)
Parameters
Gis the graph to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeRome() [1/2]

static bool ogdf::GraphIO::writeRome ( const Graph G,
const string &  filename 
)
static

Writes graph G in Rome-Lib format to file filename.

See also
writeRome(const Graph &G, std::ostream &os) for more details.
readRome(Graph &G, const string &filename)
Parameters
Gis the graph to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeRome() [2/2]

static bool ogdf::GraphIO::writeRome ( const Graph G,
std::ostream &  os 
)
static

Writes graph G in Rome-Lib format to output stream os.

See also
readRome(Graph &G, std::istream &is) for more details about the format.
Parameters
Gis the graph to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeRudy() [1/2]

static bool ogdf::GraphIO::writeRudy ( const GraphAttributes A,
const string &  filename 
)
static

Writes graph with edge weights stored in A in Rudy format to file filename.

See also
writeRudy(const GraphAttributes &A, std::ostream &os) for more details.
readRudy(GraphAttributes &A, Graph &G, const string &filename)
Parameters
Aspecifies the graph and its attributes to be written (only edge weights (as doubles) are stored in this format).
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeRudy() [2/2]

static bool ogdf::GraphIO::writeRudy ( const GraphAttributes A,
std::ostream &  os 
)
static

Writes graph with edge weights stored in A in Rudy format to output stream os.

See also
readRudy(GraphAttributes &A, Graph &G, std::istream &is)
Parameters
Aspecifies the graph and its attributes to be written (only edge weights (as doubles) are stored in this format).
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeSTP() [1/2]

template<typename T >
static bool ogdf::GraphIO::writeSTP ( const EdgeWeightedGraph< T > &  wG,
const List< node > &  terminals,
const string &  filename,
const string &  comments = "" 
)
inlinestatic

Writes an Steiner problem instance to an STP file.

Parameters
wGthe edge weighteed graph
terminalsa list of all terminals in the graph
filenamethe file to be written to
commentsa string containing all comments seperated by LF if this is an empty string no comment section will be created
Returns
true if the write operation succeeded, false otherwise
Deprecated:
"Streams should be used instead."

Definition at line 2285 of file GraphIO.h.

◆ writeSTP() [2/2]

template<typename T >
static bool ogdf::GraphIO::writeSTP ( const EdgeWeightedGraph< T > &  wG,
const List< node > &  terminals,
std::ostream &  os,
const string &  comments = "" 
)
inlinestatic

Writes an Steiner problem instance to an STP file.

Parameters
wGthe edge weighteed graph
terminalsa list of all terminals in the graph
osthe output stream be written to
commentsa string containing all comments seperated by LF if this is an empty string no comment section will be created
Returns
true if the write operation succeeded, false otherwise

Definition at line 2307 of file GraphIO.h.

◆ writeTLP() [1/8]

static bool ogdf::GraphIO::writeTLP ( const Graph G,
const string &  filename 
)
static

Writes graph G in TLP format to file filename.

See also
writeTLP(const Graph &G, std::ostream &os) for more details.
readTLP(Graph &G, const string &filename)
Parameters
Gis the graph to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeTLP() [2/8]

static bool ogdf::GraphIO::writeTLP ( const Graph G,
std::ostream &  os 
)
static

Writes graph G in TLP format to output stream os.

Parameters
Gis the graph to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeTLP() [3/8]

static bool ogdf::GraphIO::writeTLP ( const ClusterGraph C,
const string &  filename 
)
static

Writes clustered graph C in TLP format to file filename.

See also
writeTLP(const ClusterGraph &C, std::ostream &os) for more details.
readTLP(ClusterGraph &C, Graph &G, const string &filename)
Parameters
Cis the clustered graph to be written.
filenameis the name of the file to which the clustered graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeTLP() [4/8]

static bool ogdf::GraphIO::writeTLP ( const ClusterGraph C,
std::ostream &  os 
)
static

Writes clustered graph C in TLP format to output stream os.

Parameters
Cis the clustered graph to be written.
osis the output stream to which the clustered graph will be written.
Returns
true if successful, false otherwise.

◆ writeTLP() [5/8]

static bool ogdf::GraphIO::writeTLP ( const GraphAttributes A,
const string &  filename 
)
static

Writes graph with attributes A in TLP format to file filename.

See also
writeTLP(const GraphAttributes &A, std::ostream &os) for more details.
readTLP(GraphAttributes &A, Graph &G, const string &filename)
Parameters
Aspecifies the graph and its attributes to be written.
filenameis the name of the file to which the graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeTLP() [6/8]

static bool ogdf::GraphIO::writeTLP ( const GraphAttributes A,
std::ostream &  os 
)
static

Writes graph with attributes A in TLP format to output stream os.

Parameters
Aspecifies the graph and its attributes to be written.
osis the output stream to which the graph will be written.
Returns
true if successful, false otherwise.

◆ writeTLP() [7/8]

static bool ogdf::GraphIO::writeTLP ( const ClusterGraphAttributes A,
const string &  filename 
)
static

Writes graph with attributes A in TLP format to file filename.

See also
writeTLP(const ClusterGraphAttributes &A, std::ostream &os) for more details.
readTLP(ClusterGraphAttributes &A, ClusterGraph &C, Graph &G, const string &filename)
Parameters
Aspecifies the clustered graph and its attributes to be written.
filenameis the name of the file to which the clustered graph will be written.
Returns
true if successful, false otherwise.
Deprecated:
"Streams should be used instead."

◆ writeTLP() [8/8]

static bool ogdf::GraphIO::writeTLP ( const ClusterGraphAttributes A,
std::ostream &  os 
)
static

Writes graph with attributes A in TLP format to output stream os.

Parameters
Aspecifies the clustered graph and its attributes to be written.
osis the output stream to which the clustered graph will be written.
Returns
true if successful, false otherwise.

Member Data Documentation

◆ logger

Logger ogdf::GraphIO::logger
static

Definition at line 52 of file GraphIO.h.

◆ s_indentChar

char ogdf::GraphIO::s_indentChar
staticprivate

Character used for indentation.

Definition at line 2735 of file GraphIO.h.

◆ s_indentWidth

int ogdf::GraphIO::s_indentWidth
staticprivate

Number of indent characters used for indentation.

Definition at line 2736 of file GraphIO.h.

◆ svgSettings

SVGSettings ogdf::GraphIO::svgSettings
static

Definition at line 2732 of file GraphIO.h.


The documentation for this class was generated from the following file: