Changeset 1322:cfc26d103bcf in lemon-0.x for src/demo
- Timestamp:
- 04/08/05 08:34:34 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1761
- Location:
- src/demo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/demo/Makefile.am
r1296 r1322 1 1 AM_CPPFLAGS = -I$(top_srcdir)/src 2 2 LDADD = $(top_builddir)/src/lemon/libemon.la -lglpk 3 3 EXTRA_DIST = sub_graph_wrapper_demo.dim 4 4 … … 6 6 sub_graph_wrapper_demo \ 7 7 graph_to_eps_demo \ 8 lp_demo \ 8 9 dim_to_lgf 9 10 10 11 dim_to_dot_SOURCES = dim_to_dot.cc 11 12 12 sub_graph_wrapper_demo_SOURCES = sub_graph_wrapper_demo.cc tight_edge_filter_map.h 13 sub_graph_wrapper_demo_SOURCES = sub_graph_wrapper_demo.cc \ 14 tight_edge_filter_map.h 13 15 14 16 graph_to_eps_demo_SOURCES = graph_to_eps_demo.cc 15 17 18 lp_demo_SOURCES = lp_demo.cc 19 16 20 dim_to_lgf_SOURCES = dim_to_lgf.cc -
src/demo/lp_demo.cc
r1309 r1322 38 38 lp.setObj(ex); 39 39 } 40 40 lp.max(); 41 41 lp.solve(); 42 42 43 return 0;43 return lp.primalValue(); 44 44 } 45 45 … … 49 49 50 50 ListGraph g; 51 ListGraph::Node s=g.addNode(); 52 ListGraph::Node t=g.addNode(); 51 ListGraph::Node s; 52 ListGraph::Node t; 53 53 54 54 55 ListGraph::EdgeMap<double> cap(g); 55 56 56 57 GraphReader<ListGraph> reader(std::cin,g); 57 reader.addEdgeMap("capacity",cap).run(); 58 reader.addNode("source",s).addNode("target",t) 59 .addEdgeMap("capacity",cap).run(); 58 60 59 maxFlow(g,cap,s,t); 61 // std::ifstream file("../test/preflow_"); 62 // readDimacs(file, g, cap, s, t); 63 64 std::cout << "Max flow value = " << maxFlow(g,cap,s,t) << std::endl; 60 65 61 66 }
Note: See TracChangeset
for help on using the changeset viewer.