41#include <unordered_map>
133 double margin()
const {
return m_margin; }
148 const string&
width()
const {
return m_width; }
151 const string&
height()
const {
return m_height; }
689#pragma mark PMDissGraph
868#pragma mark MatrixMarket
988#pragma mark ChallengeGraph
1559 template<
typename T>
1565 for (
edge e :
wG.edges) {
1589 std::ostream&
os,
const string&
comments =
"");
1603 template<
typename T>
1605 std::ostream&
os,
const string&
comments =
"") {
1607 for (
edge e :
wG.edges) {
1658 template<
typename T>
1712 template<
typename T>
1722#pragma mark TsplibXml
1799 std::ofstream
os(filename);
1812 std::ofstream
os(filename);
1912 return attr.intWeight(e);
1923 return attr.doubleWeight(e);
Declares ClusterGraphAttributes, an extension of class GraphAttributes, to store clustergraph layout ...
Declaration of class EdgeWeightedGraph.
Declaration of class GridLayout.
Stores additional attributes of a clustered graph (like layout information).
Representation of clustered graphs.
Dynamic arrays indexed with edges.
Class for the representation of edges.
Stores additional attributes of a graph (like layout information).
static const long edgeDoubleWeight
Corresponds to edge attribute doubleWeight(edge).
static const long edgeIntWeight
Corresponds to edge attribute intWeight(edge).
Data type for general directed graphs (adjacency list representation).
internal::GraphObjectContainer< EdgeElement > edges
The container containing all edge objects.
Condensed settings for drawing SVGs.
const string & fontFamily() const
Returns the default font family.
const string & height() const
Returns the default height.
void curviness(double value)
Sets the curviness of all edges (value ranges from 0 to 1).
const string & width() const
Returns the default width.
int fontSize() const
Returns the default font size (font height in pixels).
bool m_bezierInterpolation
void fontFamily(const string &fm)
Sets the default font family to fm.
void margin(double m)
Sets the size of the margin around the drawing to m.
bool bezierInterpolation() const
Returns whether Bézier-interpolation for curved edges is enabled.
void height(const string &height)
Sets the height.
double curviness() const
Returns the curviness of the edges (value ranges from 0 to 1).
const string & fontColor() const
Returns the default font color.
void fontSize(int fs)
Sets the default font size (font height in pixels) to fs.
double margin() const
Returns the size of the margin around the drawing.
void fontColor(const string &fc)
Sets the default font color to fc.
void width(const string &width)
Sets the width.
void bezierInterpolation(bool enable)
Enables or disables Bézier-interpolation.
Utility class providing graph I/O in various exchange formats.
static bool writeEdgeListSubgraph(const Graph &G, const List< edge > &delEdges, std::ostream &os)
Writes graph G with subgraph defined by delEdges to stream os.
static bool writeTLP(const Graph &G, std::ostream &os)
Writes graph G in TLP format to output stream os.
static bool readDMF(Graph &graph, EdgeArray< T > &weights, node &source, node &sink, std::istream &is)
Reads a maximum flow instance in DIMACS format.
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.
static bool read(ClusterGraphAttributes &GA, ClusterGraph &CG, Graph &G, std::istream &is)
Reads graph G, a clustering CG of G and their attributes GA from a stream is and try to guess the con...
static bool writeDOT(const GraphAttributes &A, std::ostream &os)
Writes graph with attributes A in DOT format to output stream os.
static bool drawSVG(const GraphAttributes &A, std::ostream &os)
static bool writeGML(const ClusterGraphAttributes &A, std::ostream &os)
Writes graph with attributes A in GML format to output stream os.
static bool readDigraph6(Graph &G, std::istream &is, bool forceHeader=false)
Reads graph G in Digraph6 format from input stream is.
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.
static bool writeDigraph6(const Graph &G, std::ostream &os)
Writes graph G in Digraph6 format to output stream os.
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.
bool(*)(Graph &, std::istream &) ReaderFunc
Type of simple graph reader functions working on streams.
static bool readTsplibXml(Graph &G, std::istream &is)
Reads graph G in TsplibXml format from input stream is.
static bool readGEXF(Graph &G, std::istream &is)
Reads graph G in GEXF format from input stream is.
static bool writeGML(const ClusterGraph &C, std::ostream &os)
Writes clustered graph C in GML format to output stream os.
static bool readSTP(GraphAttributes &attr, Graph &G, std::istream &is)
Reads a graph in SteinLib format from std::istream is.
static bool readChaco(Graph &G, std::istream &is)
Reads graph G in Chaco format from input stream is.
static bool drawSVG(const ClusterGraphAttributes &A, const string &filename, const SVGSettings &settings=svgSettings)
static bool write(const Graph &G, const string &filename, WriterFunc writer=nullptr)
Writes graph G to a file with name filename and infers the format to use from the file's extension.
static bool writeGEXF(const ClusterGraph &C, std::ostream &os)
Writes clustered graph C in GEXF format to output stream os.
static bool writeSTP(const GraphAttributes &attr, const List< node > &terminals, std::ostream &os, const string &comments="")
Writes an Steiner problem instance to an STP file.
static bool readRudy(Graph &G, std::istream &is)
Reads graph G in Rudy format from input stream is.
static double & getEdgeWeightAttribute(GraphAttributes &attr, edge e)
Returns a reference to the doubleWeight()-value of attr for e.
static bool readDOT(ClusterGraph &C, Graph &G, std::istream &is)
Reads clustered graph (C, G) in DOT format from input stream is.
static bool writeGraphML(const ClusterGraphAttributes &A, std::ostream &os)
Writes graph with attributes A in GraphML format to output stream os.
static bool write(const GraphAttributes &GA, const string &filename, AttrWriterFunc writer=nullptr)
Writes graph G and its attributes GA to a file with name filename and infers the format to use from t...
static std::unordered_map< string, const FileType * > FILE_TYPE_MAP
static bool writeChaco(const Graph &G, std::ostream &os)
Writes graph G in Chaco format to output stream os.
static SVGSettings svgSettings
static bool readGraphML(Graph &G, std::istream &is)
Reads graph G in GraphML format from input stream is.
static bool writeDL(const Graph &G, std::ostream &os)
Writes graph G in DL format to output stream os.
static bool writeGraphML(const ClusterGraph &C, std::ostream &os)
Writes clustered graph C in GraphML format to output stream os.
static bool readTLP(Graph &G, std::istream &is)
Reads graph G in TLP format from input stream is.
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.
static bool readGML(GraphAttributes &A, Graph &G, std::istream &is)
Reads graph G with attributes A in GML format from input stream is.
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.
static bool readDMF(GraphAttributes &attr, Graph &graph, std::istream &is)
Reads a maximum flow instance in DIMACS format.
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.
static const std::vector< FileType > FILE_TYPES
static std::ostream & indent(std::ostream &os, int depth)
Prints indentation for indentation depth to output stream os and returns os.
bool(*)(ClusterGraphAttributes &, ClusterGraph &, Graph &, std::istream &) ClusterAttrReaderFunc
Type of cluster graph attributes reader functions working on streams.
static bool writeDOT(const ClusterGraph &C, std::ostream &os)
Writes clustered graph C in DOT format to output stream os.
static bool readMatrixMarket(Graph &G, std::istream &inStream)
Reads graph G in Matrix Market exchange format from stream inStream.
static bool readGDF(Graph &G, std::istream &is)
Reads graph G in GDF format from input stream is.
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.
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 o...
static bool writeRome(const Graph &G, std::ostream &os)
Writes graph G in Rome-Lib format to output stream os.
static bool read(Graph &G, std::istream &is)
Reads graph G from a stream is and try to guess the contained format by trying all available readers.
static char s_indentChar
Character used for indentation.
static bool writeTLP(const ClusterGraph &C, std::ostream &os)
Writes clustered graph C in TLP format to output stream os.
static bool write(const ClusterGraphAttributes &GA, const string &filename, ClusterAttrWriterFunc writer=nullptr)
Writes graph G, a clustering CG of G and their attributes CGA to a file with name filename and infers...
static bool drawSVG(const ClusterGraphAttributes &A, std::ostream &os, const SVGSettings &settings)
static bool read(ClusterGraph &CG, Graph &G, const string &filename, ClusterReaderFunc reader=nullptr)
Reads graph G and a clustering CG of G from a file with name filename and infers the used format from...
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.
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.
bool(*)(const ClusterGraph &, std::ostream &) ClusterWriterFunc
Type of cluster graph writer functions working on streams.
static bool writeRudy(const GraphAttributes &A, std::ostream &os)
Writes graph with edge weights stored in A in Rudy format to output stream os.
static bool readTLP(ClusterGraph &C, Graph &G, std::istream &is)
Reads clustered graph (C, G) in TLP format from input stream is.
static bool readGEXF(ClusterGraph &C, Graph &G, std::istream &is)
Reads clustered graph (C, G) in GEXF format from input stream is.
static bool readDMF(Graph &graph, std::istream &is)
Reads a maximum flow instance in DIMACS format.
static bool writeGraphML(const Graph &G, std::ostream &os)
Writes graph G in GraphML format to output stream os.
static void setIndentChar(char c)
Sets the indentation character to c.
static bool writeGraphML(const GraphAttributes &A, std::ostream &os)
Writes graph with attributes A in GraphML format to output stream os.
static bool read(GraphAttributes &GA, Graph &G, const string &filename, AttrReaderFunc reader=nullptr)
Reads graph G and its attributes GA from a file with name filename and infers the used format from th...
static long getEdgeWeightFlag()
Returns GraphAttributes::edgeIntWeight.
static bool writeDOT(const Graph &G, std::ostream &os)
Writes graph G in DOT format to output stream os.
static bool readSparse6(Graph &G, std::istream &is, bool forceHeader=false)
Reads graph G in Sparse6 format from input stream is.
static bool writeGML(const Graph &G, std::ostream &os)
Writes graph G in GML format to output stream os.
static bool writeDOT(const ClusterGraphAttributes &A, std::ostream &os)
Writes graph with attributes A in DOT format to output stream os.
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.
static bool readTLP(GraphAttributes &A, Graph &G, std::istream &is)
Reads graph G with attributes A in TLP format from input stream is.
bool(*)(const Graph &, std::ostream &) WriterFunc
Type of simple graph writer functions working on streams.
static bool readDOT(GraphAttributes &A, Graph &G, std::istream &is)
Reads graph G with attributes A in DOT format from input stream is.
static bool read(ClusterGraphAttributes &GA, ClusterGraph &CG, Graph &G, const string &filename, ClusterAttrReaderFunc reader=nullptr)
Reads graph G, a clustering CG of G and their attributes CGA from a file with name filename and infer...
static bool writeGML(const GraphAttributes &A, std::ostream &os)
Writes graph with attributes A in GML format to output stream os.
static bool writeGEXF(const GraphAttributes &A, std::ostream &os)
Writes graph with attributes A in GEXF format to output stream os.
bool(*)(const ClusterGraphAttributes &, std::ostream &) ClusterAttrWriterFunc
Type of cluster graph attributes writer functions working on streams.
static bool drawSVG(const GraphAttributes &A, std::ostream &os, const SVGSettings &settings)
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.
static bool read(ClusterGraph &CG, Graph &G, std::istream &is)
Reads graph G and a clustering CG of G from a stream is and try to guess the contained format by tryi...
static bool drawTikz(const ClusterGraphAttributes &A, std::ostream &os)
Draws a cluster graph from its attributes in LaTeX+TikZ format.
static bool readGraphML(GraphAttributes &A, Graph &G, std::istream &is)
Reads graph G with attributes A in GraphML format from input stream is.
static int & getEdgeWeightAttribute(GraphAttributes &attr, edge e)
Returns a reference to the intWeight()-value of attr for e.
static bool writeTLP(const GraphAttributes &A, std::ostream &os)
Writes graph with attributes A in TLP format to output stream os.
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.
static bool readDL(GraphAttributes &A, Graph &G, std::istream &is)
Reads graph G with attributes A in DL format from input stream is.
static bool readDMF(GraphAttributes &attr, Graph &graph, node &source, node &sink, std::istream &is)
Reads a maximum flow instance in DIMACS format.
static bool writeLEDA(const Graph &G, std::ostream &os)
Writes graph G in LEDA graph format to output stream os.
static bool readDL(Graph &G, std::istream &is)
Reads graph G in DL format from input stream is.
static const std::unordered_map< string, const FileType * > & getFileTypeMap()
static bool readLEDA(Graph &G, std::istream &is)
Reads graph G in LEDA graph format from input stream is.
static bool writeDL(const GraphAttributes &A, std::ostream &os)
Writes graph with attributes A in DL format to output stream os.
static bool readSTP(GraphAttributes &attr, Graph &G, List< node > &terminals, NodeArray< bool > &isTerminal, std::istream &is)
Reads a graph in SteinLib format from std::istream is.
static bool readTsplibXml(GraphAttributes &GA, Graph &G, std::istream &is)
Reads graph G with attributes GA in TsplibXml format from input stream is.
static bool readRome(Graph &G, std::istream &is)
Reads graph G in Rome-Lib format from input stream is.
static bool writeGEXF(const Graph &G, std::ostream &os)
Writes graph G in GEXF format to output stream os.
static bool writeTLP(const ClusterGraphAttributes &A, std::ostream &os)
Writes graph with attributes A in TLP format to output stream os.
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.
static bool readGEXF(GraphAttributes &A, Graph &G, std::istream &is)
Reads graph G with attributes A in GEXF format from input stream is.
bool(*)(const GraphAttributes &, std::ostream &) AttrWriterFunc
Type of simple graph attributes writer functions working on streams.
static int s_indentWidth
Number of indent characters used for indentation.
static bool writeGDF(const GraphAttributes &A, std::ostream &os)
Writes graph with attributes A in GDF format to output stream os.
static bool readGML(ClusterGraph &C, Graph &G, std::istream &is)
Reads clustered graph (C, G) in GML format from input stream is.
static bool drawSVG(const GraphAttributes &A, const string &filename, const SVGSettings &settings=svgSettings)
static bool readEdgeListSubgraph(Graph &G, List< edge > &delEdges, std::istream &is)
Reads graph G with subgraph defined by delEdges from stream is.
static bool readGraph6(Graph &G, std::istream &is, bool forceHeader=false)
Reads graph G in Graph6 format from input stream is.
static bool writeDMF(const GraphAttributes &attr, const node source, const node sink, std::ostream &os)
Writes a maximum flow problem instance to a DIMACS maximum flow file.
static bool readDOT(Graph &G, std::istream &is)
Reads graph G in DOT format from input stream is.
static bool readGML(Graph &G, std::istream &is)
Reads graph G in GML format from input stream is.
static const FileType * getFileType(const string &filename)
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.
static bool read(Graph &G, const string &filename, ReaderFunc reader=nullptr)
Reads graph G from a file with name filename and infers the used format from the file's extension.
static bool readGDF(GraphAttributes &A, Graph &G, std::istream &is)
Reads graph G with attributes A in GDF format from input stream is.
static bool writeGraph6(const Graph &G, std::ostream &os)
Writes graph G in Graph6 format to output stream os.
static bool readYGraph(Graph &G, std::istream &is)
Reads graph G in Y-graph format from input stream is.
static bool writeSparse6(const Graph &G, std::ostream &os)
Writes graph G in Sparse6 format to output stream os.
static bool read(GraphAttributes &GA, Graph &G, std::istream &is)
Reads graph G and its attributes GA from a stream is and try to guess the contained format by trying ...
static bool writeGDF(const Graph &G, std::ostream &os)
Writes graph G in GDF format to output stream os.
bool(*)(GraphAttributes &, Graph &, std::istream &) AttrReaderFunc
Type of simple graph attributes reader functions working on streams.
static bool drawSVG(const ClusterGraphAttributes &A, std::ostream &os)
static bool write(const ClusterGraph &CG, const string &filename, ClusterWriterFunc writer=nullptr)
Writes graph G and a clustering CG of G to a file with name filename and infers the format to use fro...
static bool drawTikz(const GraphAttributes &A, std::ostream &os)
Draws a graph from its attributes in LaTeX+TikZ format.
static void setIndentWidth(int w)
Sets the indentation width to w.
static bool readSTP(Graph &G, std::istream &is)
Reads a graph in SteinLib format from std::istream is.
static bool readGraphML(ClusterGraph &C, Graph &G, std::istream &is)
Reads clustered graph (C, G) in GraphML format from input stream is.
static char indentChar()
Returns the currently used indentation character.
static bool writeGEXF(const ClusterGraphAttributes &A, std::ostream &os)
Writes graph with attributes A in GEXF format to output stream os.
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.
static int indentWidth()
Returns the currently used indentation width.
bool(*)(ClusterGraph &, Graph &, std::istream &) ClusterReaderFunc
Type of cluster graph reader functions working on streams.
Representation of a graph's grid layout.
Doubly linked lists (maintaining the length of the list).
Centralized global and local logging facility working on streams like std::cout.
std::ostream & lout(Level level=Level::Default) const
stream for logging-output (local)
Dynamic arrays indexed with nodes.
Class for the representation of nodes.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition of exception classes.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
FileType(std::vector< std::string > extensions, ReaderFunc readerFunc=nullptr, WriterFunc writerFunc=nullptr, AttrReaderFunc attrReaderFunc=nullptr, AttrWriterFunc attrWriterFunc=nullptr, ClusterReaderFunc clusterReaderFunc=nullptr, ClusterWriterFunc clusterWriterFunc=nullptr, ClusterAttrReaderFunc clusterAttrReaderFunc=nullptr, ClusterAttrWriterFunc clusterAttrWriterFunc=nullptr)
ClusterAttrReaderFunc cluster_attr_reader_func
ReaderFunc auto_reader_func
ClusterReaderFunc auto_cluster_reader_func
std::vector< std::string > extensions
FileType & replaceAutoReaders(ReaderFunc readerFunc=nullptr, AttrReaderFunc attrReaderFunc=nullptr, ClusterReaderFunc clusterReaderFunc=nullptr, ClusterAttrReaderFunc clusterAttrReaderFunc=nullptr)
ClusterWriterFunc cluster_writer_func
ClusterAttrWriterFunc cluster_attr_writer_func
AttrWriterFunc attr_writer_func
ClusterReaderFunc cluster_reader_func
ClusterAttrReaderFunc auto_cluster_attr_reader_func
AttrReaderFunc attr_reader_func
AttrReaderFunc auto_attr_reader_func