1.1 --- a/src/work/jacint/bug.cc Sun Apr 17 18:57:22 2005 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,88 +0,0 @@
1.4 -#include <iostream>
1.5 -#include <queue>
1.6 -#include <vector>
1.7 -#include <math.h>
1.8 -
1.9 -#include <lemon/invalid.h>
1.10 -#include <lemon/list_graph.h>
1.11 -#include <lemon/smart_graph.h>
1.12 -#include <matching.h>
1.13 -
1.14 -using namespace lemon;
1.15 -using namespace std;
1.16 -
1.17 -
1.18 -int main() {
1.19 -
1.20 - typedef UndirSmartGraph Graph;
1.21 -
1.22 - typedef Graph::Edge Edge;
1.23 - typedef Graph::UndirEdgeIt UndirEdgeIt;
1.24 - typedef Graph::IncEdgeIt IncEdgeIt;
1.25 - typedef Graph::NodeIt NodeIt;
1.26 - typedef Graph::Node Node;
1.27 -
1.28 - typedef Graph::OutEdgeIt OutEdgeIt;
1.29 -
1.30 - Graph G;
1.31 -
1.32 - // G.clear();
1.33 - std::vector<Graph::Node> nodes;
1.34 - for (int i=0; i<5; ++i)
1.35 - nodes.push_back(G.addNode());
1.36 - G.addEdge(nodes[0], nodes[0]);
1.37 - G.addEdge(nodes[0], nodes[1]);
1.38 - G.addEdge(nodes[0], nodes[2]);
1.39 - G.addEdge(nodes[0], nodes[4]);
1.40 - G.addEdge(nodes[2], nodes[3]);
1.41 - G.addEdge(nodes[1], nodes[2]);
1.42 - G.addEdge(nodes[2], nodes[4]);
1.43 -
1.44 - for(UndirEdgeIt e(G); e!=INVALID; ++e) {
1.45 - std::cout<<G.id(e)<<" : "<<G.id(G.source(e))
1.46 - <<" " <<G.id(G.target(e))<<std::endl;
1.47 - }
1.48 -
1.49 - std::cout <<"Nodes:"<<std::endl;
1.50 -
1.51 - for(NodeIt v(G); v!=INVALID; ++v) {
1.52 - std::cout<<G.id(v)<<std::endl;
1.53 - }
1.54 -
1.55 - cout << "Dev Out edges from node " << G.id(nodes[1])<<std::endl;
1.56 - Edge f;
1.57 - for(G.firstOut(f, nodes[1]); f!=INVALID; G.nextOut(f)) {
1.58 - cout<<"edge " << G.id(f) << " goes"
1.59 - <<" from "<< G.id(G.source(f))
1.60 - << " to " << G.id(G.target(f))<<std::endl;
1.61 - }
1.62 -
1.63 - cout << "Out edges from node " << G.id(nodes[1])<<std::endl;
1.64 - for( OutEdgeIt f(G,nodes[1]); f!=INVALID; ++f ) {
1.65 - cout<<"edge " << G.id(f) << " goes"
1.66 - <<" from "<< G.id(G.source(f))
1.67 - << " to " << G.id(G.target(f))<<std::endl;
1.68 - }
1.69 -
1.70 - std::cout<<"Edges of node " << G.id(nodes[1])<<std::endl;
1.71 - for( IncEdgeIt f(G,nodes[1]); f!=INVALID; ++f ) {
1.72 - cout<<"edge " << G.id(f) << " goes"
1.73 - <<" from "<< G.id(G.source(f))
1.74 - << " to " << G.id(G.target(f))<<std::endl;
1.75 - }
1.76 -
1.77 - //return 0;
1.78 -
1.79 - //ez a ket for ciklus meg lefut - bar hibas eleken iteral -, de a
1.80 - //matching.h-s mar segfaultol
1.81 -
1.82 - for( IncEdgeIt f(G,nodes[1]); f!=INVALID; ++f ) {
1.83 - std::cout<<"edge " << G.id(f)<< " goes to " << G.id(G.target(f))<<std::endl;
1.84 - }
1.85 -
1.86 - MaxMatching<Graph> max_matching(G);
1.87 - max_matching.runEdmonds(0);
1.88 -
1.89 - return 0;
1.90 -}
1.91 -