abLEMON 1.9.0-101-gccb8629
A maintained fork of LEMON
Loading...
Searching...
No Matches
LEMON Graph Format

Reading and writing LEMON Graph Format. More...

Files

file  lgf_reader.h
file  lgf_writer.h

Classes

class  DigraphReader< DGR >
 LGF reader for directed graphs More...
class  GraphReader< GR >
 LGF reader for undirected graphs More...
class  BpGraphReader< BGR >
 LGF reader for bipartite graphs More...
class  SectionReader
 Section reader class. More...
class  LgfContents
 Reader for the contents of the LGF file. More...
class  DigraphWriter< DGR >
 LGF writer for directed graphs More...
class  GraphWriter< GR >
 LGF writer for undirected graphs More...
class  BpGraphWriter< BGR >
 LGF writer for undirected bipartite graphs More...
class  SectionWriter
 Section writer class. More...

Functions

template< typename TDGR >
DigraphReader< TDGR > digraphReader (TDGR &digraph, std::istream &is)
 Return a DigraphReader class.
template< typename TGR >
GraphReader< TGR > graphReader (TGR &graph, std::istream &is)
 Return a GraphReader class.
template< typename TBGR >
BpGraphReader< TBGR > bpGraphReader (TBGR &graph, std::istream &is)
 Return a BpGraphReader class.
SectionReader sectionReader (std::istream &is)
 Return a SectionReader class.
template< typename TDGR >
DigraphWriter< TDGR > digraphWriter (const TDGR &digraph, std::ostream &os)
 Return a DigraphWriter class.
template< typename TGR >
GraphWriter< TGR > graphWriter (const TGR &graph, std::ostream &os)
 Return a GraphWriter class.
template< typename TBGR >
BpGraphWriter< TBGR > bpGraphWriter (const TBGR &graph, std::ostream &os)
 Return a BpGraphWriter class.
SectionWriter sectionWriter (std::ostream &os)
 Return a SectionWriter class.

Detailed Description

This group contains methods for reading and writing LEMON Graph Format.

Function Documentation

◆ digraphReader()

template< typename TDGR >
DigraphReader< TDGR > digraphReader ( TDGR & digraph,
std::istream & is )
related

This function just returns a DigraphReader class.

With this function a digraph can be read from an LGF file or input stream with several maps and attributes. For example, there is network flow problem on a digraph, i.e. a digraph with a capacity map on the arcs and source and target nodes. This digraph can be read with the following code:

ListDigraph digraph;
ListDigraph::ArcMap< int > cap( digraph );
ListDigraph::Node src , trg;
digraphReader( digraph , std::cin )
.arcMap( "capacity" , cap )
.node( "source" , src )
.node( "target" , trg )
.run();
A general directed graph structure.
Definition list_graph.h:337

For a complete documentation, please see the DigraphReader class documentation.

Warning
Don't forget to put the run() to the end of the parameter list.
See also
digraphReader( TDGR & digraph , const std::string & fn )
digraphReader( TDGR & digraph , const char * fn )

◆ graphReader()

template< typename TGR >
GraphReader< TGR > graphReader ( TGR & graph,
std::istream & is )
related

This function just returns a GraphReader class.

With this function a graph can be read from an LGF file or input stream with several maps and attributes. For example, there is weighted matching problem on a graph, i.e. a graph with a weight map on the edges. This graph can be read with the following code:

ListGraph graph;
ListGraph::EdgeMap< int > weight( graph );
graphReader( graph , std::cin ).edgeMap( "weight" , weight ).run();
A general undirected graph structure.
Definition list_graph.h:1189

For a complete documentation, please see the GraphReader class documentation.

Warning
Don't forget to put the run() to the end of the parameter list.
See also
graphReader( TGR & graph , const std::string & fn )
graphReader( TGR & graph , const char * fn )

◆ bpGraphReader()

template< typename TBGR >
BpGraphReader< TBGR > bpGraphReader ( TBGR & graph,
std::istream & is )
related

This function just returns a BpGraphReader class.

With this function a graph can be read from an LGF file or input stream with several maps and attributes. For example, there is bipartite weighted matching problem on a graph, i.e. a graph with a weight map on the edges. This graph can be read with the following code:

ListBpGraph::EdgeMap< int > weight( graph );
bpGraphReader( graph , std::cin ).edgeMap( "weight" , weight ).run();
A general undirected graph structure.
Definition list_graph.h:2117

For a complete documentation, please see the BpGraphReader class documentation.

Warning
Don't forget to put the run() to the end of the parameter list.
See also
bpGraphReader( TBGR & graph , const std::string & fn )
bpGraphReader( TBGR & graph , const char * fn )

◆ sectionReader()

SectionReader sectionReader ( std::istream & is)
related

This function just returns a SectionReader class.

Please see SectionReader documentation about the custom section input.

See also
sectionReader( const std::string & fn )
sectionReader( const char * fn )

◆ digraphWriter()

template< typename TDGR >
DigraphWriter< TDGR > digraphWriter ( const TDGR & digraph,
std::ostream & os )
related

This function just returns a DigraphWriter class.

With this function a digraph can be write to a file or output stream in LGF format with several maps and attributes. For example, with the following code a network flow problem can be written to the standard output, i.e. a digraph with a capacity map on the arcs and source and target nodes:

ListDigraph digraph;
ListDigraph::ArcMap< int > cap( digraph );
ListDigraph::Node src , trg;
// Setting the capacity map and source and target nodes
digraphWriter( digraph , std::cout )
.arcMap( "capacity" , cap )
.node( "source" , src )
.node( "target" , trg )
.run();

For a complete documentation, please see the DigraphWriter class documentation.

Warning
Don't forget to put the run() to the end of the parameter list.
See also
digraphWriter( const TDGR & digraph , const std::string & fn )
digraphWriter( const TDGR & digraph , const char * fn )

◆ graphWriter()

template< typename TGR >
GraphWriter< TGR > graphWriter ( const TGR & graph,
std::ostream & os )
related

This function just returns a GraphWriter class.

With this function a graph can be write to a file or output stream in LGF format with several maps and attributes. For example, with the following code a weighted matching problem can be written to the standard output, i.e. a graph with a weight map on the edges:

ListGraph graph;
ListGraph::EdgeMap< int > weight( graph );
// Setting the weight map
graphWriter( graph , std::cout ).edgeMap( "weight" , weight ).run();

For a complete documentation, please see the GraphWriter class documentation.

Warning
Don't forget to put the run() to the end of the parameter list.
See also
graphWriter( const TGR & graph , const std::string & fn )
graphWriter( const TGR & graph , const char * fn )

◆ bpGraphWriter()

template< typename TBGR >
BpGraphWriter< TBGR > bpGraphWriter ( const TBGR & graph,
std::ostream & os )
related

This function just returns a BpGraphWriter class.

With this function a bipartite graph can be write to a file or output stream in LGF format with several maps and attributes. For example, with the following code a bipartite weighted matching problem can be written to the standard output, i.e. a graph with a weight map on the edges:

ListBpGraph::EdgeMap< int > weight( graph );
// Setting the weight map
bpGraphWriter( graph , std::cout ).edgeMap( "weight" , weight ).run();

For a complete documentation, please see the BpGraphWriter class documentation.

Warning
Don't forget to put the run() to the end of the parameter list.
See also
bpGraphWriter( const TBGR & graph , const std::string & fn )
bpGraphWriter( const TBGR & graph , const char * fn )

◆ sectionWriter()

SectionWriter sectionWriter ( std::ostream & os)
related

This function just returns a SectionWriter class.

Please see SectionWriter documentation about the custom section output.

See also
sectionWriter( const std::string & fn )
sectionWriter( const char * fn )