Index: doc/lgf.dox
===================================================================
--- doc/lgf.dox	(revision 192)
+++ doc/lgf.dox	(revision 201)
@@ -79,8 +79,16 @@
 \endcode
 
-The \c \@edges is just a synonym of \c \@arcs.
+The \c \@edges is just a synonym of \c \@arcs. The @arcs section can
+also store the edge set of an undirected graph. In such case there is
+a conventional method for store arc maps in the file, if two columns
+has the same caption with \c '+' and \c '-' prefix, then these columns
+can be regarded as the values of an arc map.
 
 The \c \@attributes section contains key-value pairs, each line
-consists of two tokens, an attribute name, and then an attribute value.
+consists of two tokens, an attribute name, and then an attribute
+value. The value of the attribute could be also a label value of a
+node or an edge, or even an edge label prefixed with \c '+' or \c '-',
+which regards to the forward or backward directed arc of the
+corresponding edge.
 
 \code
Index: lemon/graph_utils.h
===================================================================
--- lemon/graph_utils.h	(revision 199)
+++ lemon/graph_utils.h	(revision 169)
@@ -603,5 +603,5 @@
         for (typename From::ArcIt it(from); it != INVALID; ++it) {
           arcRefMap[it] = to.addArc(nodeRefMap[from.source(it)], 
-				    nodeRefMap[from.target(it)]);
+                                          nodeRefMap[from.target(it)]);
         }
       }
@@ -629,6 +629,6 @@
         }
         for (typename From::EdgeIt it(from); it != INVALID; ++it) {
-          edgeRefMap[it] = to.addEdge(nodeRefMap[from.u(it)], 
-				      nodeRefMap[from.v(it)]);
+          edgeRefMap[it] = to.addArc(nodeRefMap[from.source(it)], 
+				       nodeRefMap[from.target(it)]);
         }
       }
@@ -926,8 +926,7 @@
 
       Value operator[](const Key& key) const {
-        bool forward = _from.u(key) != _from.v(key) ?
-	  _node_ref[_from.source(key)] == 
-	  _to.source(_to.direct(_edge_ref[key], true)) :
-	  _from.direction(key);
+        bool forward = 
+          (_from.direction(key) == 
+	   (_node_ref[_from.source(key)] == _to.source(_edge_ref[key])));
 	return _to.direct(_edge_ref[key], forward); 
       }
Index: lemon/lgf_reader.h
===================================================================
--- lemon/lgf_reader.h	(revision 197)
+++ lemon/lgf_reader.h	(revision 201)
@@ -1227,4 +1227,10 @@
   /// The only difference is that this class can handle edges and
   /// edge maps as well as arcs and arc maps.
+  ///
+  /// The columns in the \c \@edges (or \c \@arcs) section are the
+  /// edge maps. However, if there are two maps with the same name
+  /// prefixed with \c '+' and \c '-', then these can be read into an
+  /// arc map.  Similarly, an attribute can be read into an arc, if
+  /// it's value is an edge label prefixed with \c '+' or \c '-'.
   template <typename _Graph>
   class GraphReader {
Index: lemon/lgf_writer.h
===================================================================
--- lemon/lgf_writer.h	(revision 197)
+++ lemon/lgf_writer.h	(revision 201)
@@ -915,4 +915,10 @@
   /// The only difference is that this class can handle edges and
   /// edge maps as well as arcs and arc maps.
+  ///
+  /// The arc maps are written into the file as two columns, the
+  /// caption of the columns are the name of the map prefixed with \c
+  /// '+' and \c '-'. The arcs are written into the \c \@attributes
+  /// section as a \c '+' or a \c '-' prefix (depends on the direction
+  /// of the arc) and the label of corresponding edge.
   template <typename _Graph>
   class GraphWriter {
Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt	(revision 200)
+++ test/CMakeLists.txt	(revision 171)
@@ -11,5 +11,4 @@
   dim_test
   error_test
-  graph_copy_test
   graph_test
   graph_utils_test
Index: test/Makefile.am
===================================================================
--- test/Makefile.am	(revision 200)
+++ test/Makefile.am	(revision 171)
@@ -16,5 +16,4 @@
         test/dim_test \
 	test/error_test \
-	test/graph_copy_test \
 	test/graph_test \
 	test/graph_utils_test \
@@ -38,5 +37,4 @@
 test_dim_test_SOURCES = test/dim_test.cc
 test_error_test_SOURCES = test/error_test.cc
-test_graph_copy_test_SOURCES = test/graph_copy_test.cc
 test_graph_test_SOURCES = test/graph_test.cc
 test_graph_utils_test_SOURCES = test/graph_utils_test.cc
Index: st/graph_copy_test.cc
===================================================================
--- test/graph_copy_test.cc	(revision 200)
+++ 	(revision )
@@ -1,192 +1,0 @@
-/* -*- C++ -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library
- *
- * Copyright (C) 2003-2008
- * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
- * (Egervary Research Group on Combinatorial Optimization, EGRES).
- *
- * Permission to use, modify and distribute this software is granted
- * provided that this copyright notice appears in all copies. For
- * precise terms see the accompanying LICENSE file.
- *
- * This software is provided "AS IS" with no warranty of any kind,
- * express or implied, and with no claim as to its suitability for any
- * purpose.
- *
- */
-
-#include <lemon/smart_graph.h>
-#include <lemon/list_graph.h>
-#include <lemon/lgf_reader.h>
-#include <lemon/graph_utils.h>
-#include <lemon/error.h>
-
-#include "test_tools.h"
-
-using namespace std;
-using namespace lemon;
-
-void digraph_copy_test() {
-  const int nn = 10;
-
-  SmartDigraph from;
-  SmartDigraph::NodeMap<int> fnm(from);
-  SmartDigraph::ArcMap<int> fam(from);
-  SmartDigraph::Node fn = INVALID;
-  SmartDigraph::Arc fa = INVALID;
-
-  std::vector<SmartDigraph::Node> fnv;
-  for (int i = 0; i < nn; ++i) {
-    SmartDigraph::Node node = from.addNode();
-    fnv.push_back(node);
-    fnm[node] = i * i;
-    if (i == 0) fn = node;
-  }
-
-  for (int i = 0; i < nn; ++i) {
-    for (int j = 0; j < nn; ++j) {
-      SmartDigraph::Arc arc = from.addArc(fnv[i], fnv[j]);
-      fam[arc] = i + j * j;
-      if (i == 0 && j == 0) fa = arc;
-    }
-  }
-
-  ListDigraph to;
-  ListDigraph::NodeMap<int> tnm(to);
-  ListDigraph::ArcMap<int> tam(to);
-  ListDigraph::Node tn;
-  ListDigraph::Arc ta;
-
-  SmartDigraph::NodeMap<ListDigraph::Node> nr(from);
-  SmartDigraph::ArcMap<ListDigraph::Arc> er(from);
-
-  ListDigraph::NodeMap<SmartDigraph::Node> ncr(to);
-  ListDigraph::ArcMap<SmartDigraph::Arc> ecr(to);
-
-  DigraphCopy<ListDigraph, SmartDigraph>(to, from).
-    nodeMap(tnm, fnm).arcMap(tam, fam).
-    nodeRef(nr).arcRef(er).
-    nodeCrossRef(ncr).arcCrossRef(ecr).
-    node(tn, fn).arc(ta, fa).run();
-
-  for (SmartDigraph::NodeIt it(from); it != INVALID; ++it) {
-    check(ncr[nr[it]] == it, "Wrong copy.");
-    check(fnm[it] == tnm[nr[it]], "Wrong copy.");
-  }
-
-  for (SmartDigraph::ArcIt it(from); it != INVALID; ++it) {
-    check(ecr[er[it]] == it, "Wrong copy.");
-    check(fam[it] == tam[er[it]], "Wrong copy.");
-    check(nr[from.source(it)] == to.source(er[it]), "Wrong copy.");
-    check(nr[from.target(it)] == to.target(er[it]), "Wrong copy.");
-  }
-
-  for (ListDigraph::NodeIt it(to); it != INVALID; ++it) {
-    check(nr[ncr[it]] == it, "Wrong copy.");
-  }
-
-  for (ListDigraph::ArcIt it(to); it != INVALID; ++it) {
-    check(er[ecr[it]] == it, "Wrong copy.");
-  }
-  check(tn == nr[fn], "Wrong copy.");
-  check(ta == er[fa], "Wrong copy.");
-}
-
-void graph_copy_test() {
-  const int nn = 10;
-
-  SmartGraph from;
-  SmartGraph::NodeMap<int> fnm(from);
-  SmartGraph::ArcMap<int> fam(from);
-  SmartGraph::EdgeMap<int> fem(from);
-  SmartGraph::Node fn = INVALID;
-  SmartGraph::Arc fa = INVALID;
-  SmartGraph::Edge fe = INVALID;
-
-  std::vector<SmartGraph::Node> fnv;
-  for (int i = 0; i < nn; ++i) {
-    SmartGraph::Node node = from.addNode();
-    fnv.push_back(node);
-    fnm[node] = i * i;
-    if (i == 0) fn = node;
-  }
-
-  for (int i = 0; i < nn; ++i) {
-    for (int j = 0; j < nn; ++j) {
-      SmartGraph::Edge edge = from.addEdge(fnv[i], fnv[j]);
-      fem[edge] = i * i + j * j;
-      fam[from.direct(edge, true)] = i + j * j;
-      fam[from.direct(edge, false)] = i * i + j;
-      if (i == 0 && j == 0) fa = from.direct(edge, true);
-      if (i == 0 && j == 0) fe = edge;
-    }
-  }
-  
-  ListGraph to;
-  ListGraph::NodeMap<int> tnm(to);
-  ListGraph::ArcMap<int> tam(to);
-  ListGraph::EdgeMap<int> tem(to);
-  ListGraph::Node tn;
-  ListGraph::Arc ta;
-  ListGraph::Edge te;
-
-  SmartGraph::NodeMap<ListGraph::Node> nr(from);
-  SmartGraph::ArcMap<ListGraph::Arc> ar(from);
-  SmartGraph::EdgeMap<ListGraph::Edge> er(from);
-
-  ListGraph::NodeMap<SmartGraph::Node> ncr(to);
-  ListGraph::ArcMap<SmartGraph::Arc> acr(to);
-  ListGraph::EdgeMap<SmartGraph::Edge> ecr(to);
-
-  GraphCopy<ListGraph, SmartGraph>(to, from).
-    nodeMap(tnm, fnm).arcMap(tam, fam).edgeMap(tem, fem).
-    nodeRef(nr).arcRef(ar).edgeRef(er).
-    nodeCrossRef(ncr).arcCrossRef(acr).edgeCrossRef(ecr).
-    node(tn, fn).arc(ta, fa).edge(te, fe).run();
-
-  for (SmartGraph::NodeIt it(from); it != INVALID; ++it) {
-    check(ncr[nr[it]] == it, "Wrong copy.");
-    check(fnm[it] == tnm[nr[it]], "Wrong copy.");
-  }
-
-  for (SmartGraph::ArcIt it(from); it != INVALID; ++it) {
-    check(acr[ar[it]] == it, "Wrong copy.");
-    check(fam[it] == tam[ar[it]], "Wrong copy.");
-    check(nr[from.source(it)] == to.source(ar[it]), "Wrong copy.");
-    check(nr[from.target(it)] == to.target(ar[it]), "Wrong copy.");
-  }
-
-  for (SmartGraph::EdgeIt it(from); it != INVALID; ++it) {
-    check(ecr[er[it]] == it, "Wrong copy.");
-    check(fem[it] == tem[er[it]], "Wrong copy.");
-    check(nr[from.u(it)] == to.u(er[it]) || nr[from.u(it)] == to.v(er[it]), 
-	  "Wrong copy.");
-    check(nr[from.v(it)] == to.u(er[it]) || nr[from.v(it)] == to.v(er[it]), 
-	  "Wrong copy.");
-    check((from.u(it) != from.v(it)) == (to.u(er[it]) != to.v(er[it])), 
-	  "Wrong copy.");
-  }
-
-  for (ListGraph::NodeIt it(to); it != INVALID; ++it) {
-    check(nr[ncr[it]] == it, "Wrong copy.");
-  }
-
-  for (ListGraph::ArcIt it(to); it != INVALID; ++it) {
-    check(ar[acr[it]] == it, "Wrong copy.");
-  }
-  for (ListGraph::EdgeIt it(to); it != INVALID; ++it) {
-    check(er[ecr[it]] == it, "Wrong copy.");
-  }
-  check(tn == nr[fn], "Wrong copy.");
-  check(ta == ar[fa], "Wrong copy.");
-  check(te == er[fe], "Wrong copy.");
-}
-
-
-int main() {
-  digraph_copy_test();
-  graph_copy_test();
-
-  return 0; 
-}
