This group contains methods for reading and writing LEMON Graph Format.
Classes | |
class | DigraphReader< DGR > |
LGF reader for directed graphs More... | |
class | GraphReader< GR > |
LGF reader for undirected 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 directed graphs More... | |
class | SectionWriter |
Section writer class. More... | |
Files | |
file | lgf_reader.h |
LEMON Graph Format reader. | |
file | lgf_writer.h |
LEMON Graph Format writer. | |
Friends | |
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. | |
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. | |
SectionWriter | sectionWriter (std::ostream &os) |
Return a SectionWriter class. |
DigraphReader< TDGR > digraphReader | ( | TDGR & | digraph, |
std::istream & | is = std::cin |
||
) | [friend, inherited] |
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> cm(digraph); ListDigraph::Node src, trg; digraphReader(digraph, std::cin). arcMap("capacity", cap). node("source", src). node("target", trg). run();
For a complete documentation, please see the DigraphReader class documentation.
GraphReader< TGR > graphReader | ( | TGR & | graph, |
std::istream & | is = std::cin |
||
) | [friend, inherited] |
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();
For a complete documentation, please see the GraphReader class documentation.
SectionReader sectionReader | ( | std::istream & | is | ) | [friend, inherited] |
This function just returns a SectionReader class.
Please see SectionReader documentation about the custom section input.
DigraphWriter< TDGR > digraphWriter | ( | const TDGR & | digraph, |
std::ostream & | os = std::cout |
||
) | [friend, inherited] |
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.
GraphWriter< TGR > graphWriter | ( | const TGR & | graph, |
std::ostream & | os = std::cout |
||
) | [friend, inherited] |
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.
SectionWriter sectionWriter | ( | std::ostream & | os | ) | [friend, inherited] |
This function just returns a SectionWriter class.
Please see SectionWriter documentation about the custom section output.