# HG changeset patch # User alpar # Date 1126692043 0 # Node ID df3820d7989d8fe4926ac1ad30dfdac0c6711b27 # Parent 13648409b596e0d4c36a4134b666f8ea89e017c5 Better doc. diff -r 13648409b596 -r df3820d7989d doc/graph_orientation.dox --- a/doc/graph_orientation.dox Tue Sep 13 12:41:02 2005 +0000 +++ b/doc/graph_orientation.dox Wed Sep 14 10:00:43 2005 +0000 @@ -6,7 +6,28 @@ \brief Graph orientation with lower bound requirement on the in-degree of the nodes. +This demo shows an adaptation of the well-known "preflow push" algorithm to +a simple graph orientation problem. +The input of the problem is a(n undirected) graph and an integer value +f(n) assigned to each node \e n. The task is to find an orientation +of the edges for which the number of edge arriving to each node \e n is at +least least f(n). + +In fact, the algorithm reads a directed graph and computes a set of edges to +be reversed in order to achieve the in-degree requirement. +This input is given using +\ref graph-io-page ".lgf (Lemon Graph Format)" file. It should contain +three node maps. The one called "f" contains the in-degree requirements, while +"coordinate_x" and "coordinate_y" indicate the position of the nodes. These +latter ones are used to generate the output, which is a .eps file. + + +\section go-alg-dec The C++ source file + +Here you find how to solve the problem above using lemon. + +\subsection go-alg-head Headers and convenience typedefs First we include some important headers. @@ -36,6 +57,8 @@ \skip typedef \until InEdgeIt +\subsection go-alg-main The main() function + Well, we are ready to start main(). \skip main \until { @@ -47,7 +70,7 @@ \until } Now, we read a graph \c g, and a map \c f containing -the in-deg requirements from a \ref graph-io-page ".lgf" (Lemon Graph Format) +the in-deg requirements from a \ref graph-io-page ".lgf (Lemon Graph Format)" file. To generate the output picture, we also read the node titles (\c id) and coordinates (\c coords). So, first we create the graph