COIN-OR::LEMON - Graph Library

Changeset 877:141f9c0db4a3 in lemon-1.2 for test/connectivity_test.cc


Ignore:
Timestamp:
03/06/10 15:35:12 (10 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Children:
878:f802439d2b58, 880:38213abd2911, 909:f112c18bc304
Phase:
public
Message:

Unify the sources (#339)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/connectivity_test.cc

    r649 r877  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2010
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    3030  typedef ListDigraph Digraph;
    3131  typedef Undirector<Digraph> Graph;
    32  
    33   {
    34     Digraph d;
    35     Digraph::NodeMap<int> order(d);
    36     Graph g(d);
    37    
     32
     33  {
     34    Digraph d;
     35    Digraph::NodeMap<int> order(d);
     36    Graph g(d);
     37
    3838    check(stronglyConnected(d), "The empty digraph is strongly connected");
    3939    check(countStronglyConnectedComponents(d) == 0,
     
    4949    check(countBiEdgeConnectedComponents(g) == 0,
    5050          "The empty graph has 0 bi-edge-connected component");
    51          
     51
    5252    check(dag(d), "The empty digraph is DAG.");
    5353    check(checkedTopologicalSort(d, order), "The empty digraph is DAG.");
     
    8383    check(countBiEdgeConnectedComponents(g) == 1,
    8484          "This graph has 1 bi-edge-connected component");
    85          
     85
    8686    check(dag(d), "This digraph is DAG.");
    8787    check(checkedTopologicalSort(d, order), "This digraph is DAG.");
     
    102102    Digraph::NodeMap<int> order(d);
    103103    Graph g(d);
    104    
     104
    105105    Digraph::Node n1 = d.addNode();
    106106    Digraph::Node n2 = d.addNode();
     
    109109    Digraph::Node n5 = d.addNode();
    110110    Digraph::Node n6 = d.addNode();
    111    
     111
    112112    d.addArc(n1, n3);
    113113    d.addArc(n3, n2);
     
    137137    check(!parallelFree(g), "This graph is not parallel-free.");
    138138    check(!simpleGraph(g), "This graph is not simple.");
    139    
     139
    140140    d.addArc(n3, n3);
    141    
     141
    142142    check(!loopFree(d), "This digraph is not loop-free.");
    143143    check(!loopFree(g), "This graph is not loop-free.");
    144144    check(!simpleGraph(d), "This digraph is not simple.");
    145    
     145
    146146    d.addArc(n3, n2);
    147    
     147
    148148    check(!parallelFree(d), "This digraph is not parallel-free.");
    149149  }
    150  
     150
    151151  {
    152152    Digraph d;
    153153    Digraph::ArcMap<bool> cutarcs(d, false);
    154154    Graph g(d);
    155    
     155
    156156    Digraph::Node n1 = d.addNode();
    157157    Digraph::Node n2 = d.addNode();
     
    173173    d.addArc(n6, n7);
    174174    d.addArc(n7, n6);
    175    
     175
    176176    check(!stronglyConnected(d), "This digraph is not strongly connected");
    177177    check(countStronglyConnectedComponents(d) == 3,
     
    236236    Digraph d;
    237237    Digraph::NodeMap<int> order(d);
    238    
     238
    239239    Digraph::Node belt = d.addNode();
    240240    Digraph::Node trousers = d.addNode();
     
    256256    d.addArc(shirt, necktie);
    257257    d.addArc(necktie, coat);
    258    
     258
    259259    check(dag(d), "This digraph is DAG.");
    260260    topologicalSort(d, order);
     
    268268    ListGraph g;
    269269    ListGraph::NodeMap<bool> map(g);
    270    
     270
    271271    ListGraph::Node n1 = g.addNode();
    272272    ListGraph::Node n2 = g.addNode();
     
    284284    g.addEdge(n4, n7);
    285285    g.addEdge(n5, n7);
    286    
     286
    287287    check(bipartite(g), "This graph is bipartite");
    288288    check(bipartitePartitions(g, map), "This graph is bipartite");
    289    
     289
    290290    check(map[n1] == map[n2] && map[n1] == map[n6] && map[n1] == map[n7],
    291291          "Wrong bipartitePartitions()");
Note: See TracChangeset for help on using the changeset viewer.