Index: src/work/jacint/graph_gen.h
===================================================================
--- src/work/jacint/graph_gen.h	(revision 534)
+++ src/work/jacint/graph_gen.h	(revision 558)
@@ -1,14 +1,5 @@
 // -*- c++ -*-
-//randomGraph(i,j) gives a random graph on i nodes and j edges.
 #include <vector>
 #include <cstdlib>
-
-//#include <list_graph.h>
-//#include <time_measure.h>
-//#include <for_each_macros.h>
-//#include <bfs_iterator.h>
-//#include <bipartite_graph_wrapper.h>
-//#include <maps.h>
-//#include <max_flow.h>
 
 namespace hugo {
@@ -39,9 +30,10 @@
 
 
+  /// Generates a random graph with n nodes and m edges.
+  /// Before generating the random graph, \c g.clear() is called.
   template<typename Graph>
-  void randomGraph (Graph& g, int n, int m) {
-    typedef typename Graph::Node Node;
+  void randomGraph(Graph& g, int n, int m) {
     g.clear();
-    std::vector<Node> nodes;
+    std::vector<typename Graph::Node> nodes;
     for (int i=0; i<n; ++i)
       nodes.push_back(g.addNode());
@@ -50,3 +42,23 @@
   }
 
-}
+  /// Generates a random bipartite graph with a and b nodes 
+  /// in the color classes and m edges.
+  /// According to the bipartite graph concept, the resulting 
+  /// graph is directed from the first class to the second one.
+  /// Before generating the random graph, \c g.clear() is called.
+  template<typename Graph>
+  void randomBipartiteGraph(Graph& g, int a, int b, int m) {
+    g.clear();
+    std::vector<typename Graph::Node> s_nodes;
+    std::vector<typename Graph::Node> t_nodes;
+    for (int i=0; i<a; ++i)
+      ///\bug g.addNode(g.S_CLASS) would be better.
+      s_nodes.push_back(g.addNode(false));
+    for (int i=0; i<b; ++i)
+      ///\bug g.addNode(g.T_CLASS) would be better.
+      t_nodes.push_back(g.addNode(true));
+    for (int i=0; i<m; ++i) 
+      g.addEdge(s_nodes[random(a)], t_nodes[random(b)]);
+  }
+
+} //namespace hugo
