Changeset 1641:77f6ab7ad66f in lemon-0.x
- Timestamp:
- 08/18/05 00:07:35 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2154
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
demo/dijkstra_demo.cc
r1636 r1641 23 23 /// facilities supplied by our implementation: for the detailed 24 24 /// documentation of the LEMON Dijkstra class read \ref lemon::Dijkstra "this". 25 /// 26 /// \include dijkstra_demo.cc 25 27 26 28 #include <iostream> … … 28 30 #include <lemon/list_graph.h> 29 31 #include <lemon/dijkstra.h> 30 //#include <lemon/graph_writer.h>31 32 32 33 using namespace lemon; … … 70 71 len.set(v5_t, 8); 71 72 72 std::cout << "This program is a simple demo of the LEMON Dijkstra class."<<std::endl; 73 std::cout << "We calculate the shortest path from node s to node t in a graph."<<std::endl; 74 std::cout <<std::endl; 73 std::cout << "This program is a simple demo of the LEMON Dijkstra class." 74 << std::endl; 75 std::cout << 76 "We calculate the shortest path from node s to node t in a graph." 77 << std::endl; 78 std::cout << std::endl; 75 79 76 80 77 std::cout << "The id of s is " << g.id(s)<< ", the id of t is " << g.id(t)<<"."<<std::endl; 81 std::cout << "The id of s is " << g.id(s)<< ", the id of t is " 82 << g.id(t) << "." << std::endl; 78 83 79 84 std::cout << "Dijkstra algorithm demo..." << std::endl; 80 81 85 82 86 Dijkstra<Graph, LengthMap> dijkstra_test(g,len); 83 87 84 88 dijkstra_test.run(s); 89 90 std::cout << "The distance of node t from node s: " 91 << dijkstra_test.dist(t) << std::endl; 85 92 93 std::cout << "The shortest path from s to t goes through the following " 94 << "nodes (the first one is t, the last one is s): " 95 << std::endl; 96 97 for (Node v=t;v != s; v=dijkstra_test.predNode(v)) { 98 std::cout << g.id(v) << "<-"; 99 } 86 100 87 std::cout << "The distance of node t from node s: " << dijkstra_test.dist(t)<<std::endl;88 89 std::cout << "The shortest path from s to t goes through the following nodes (the first one is t, the last one is s): "<<std::endl;90 91 for (Node v=t;v != s; v=dijkstra_test.predNode(v)){92 std::cout << g.id(v) << "<-";93 }94 101 std::cout << g.id(s) << std::endl; 95 102 96 97 103 return 0; 98 104 } 99 100 101 102 103 104 105 106 107 -
demo/dim_to_lgf.cc
r1626 r1641 21 21 /// This program converts various DIMACS formats to the LEMON Graph Format 22 22 /// (LGF). 23 /// 24 /// \include dim_to_lgf.cc 23 25 24 26 #include <iostream> -
demo/graph_to_eps_demo.cc
r1630 r1641 26 26 /// color, shape, size, title etc.) of nodes and edges individually 27 27 /// using appropriate \ref maps-page "graph maps". 28 /// 29 /// \include graph_to_eps_demo.cc 28 30 29 31 #include <cmath> -
demo/hello_lemon.cc
r1636 r1641 22 22 /// the very basic notions of the LEMON library: \ref graphs "graphs" and 23 23 /// \ref maps-page "maps". Click on the links to read more about these. 24 /// 25 /// \include hello_lemon.cc 24 26 25 27 #include <iostream> … … 82 84 std::cout << std::endl; 83 85 for (EdgeIt i(g); i!=INVALID; ++i) 84 std::cout << "length(" << g.id(g.source(i)) << "," << g.id(g.target(i)) << ")="<<length[i]<<std::endl; 86 std::cout << "length(" << g.id(g.source(i)) << "," 87 << g.id(g.target(i)) << ")="<<length[i]<<std::endl; 85 88 86 89 std::cout << std::endl; -
demo/kruskal_demo.cc
r1584 r1641 21 21 /// This demo program shows how to find a minimum weight spanning tree 22 22 /// in a graph by using the Kruskal algorithm. 23 /// 24 /// \include kruskal_demo.cc 23 25 24 26 #include <iostream> … … 124 126 std::cout << g.id(tree_edge_vec[i]) << ";" ; 125 127 std::cout << std::endl; 126 std::cout << "The size of the tree again is: "<< tree_edge_vec.size()<< std::endl; 128 std::cout << "The size of the tree again is: "<< tree_edge_vec.size() 129 << std::endl; 127 130 128 131 -
demo/lp_demo.cc
r1636 r1641 24 24 /// example). For the detailed documentation of the LEMON LP solver 25 25 /// interface read \ref lemon::LpSolverBase "this". 26 /// 27 /// \include lp_demo.cc 26 28 27 29 #include <lemon/lp.h> -
demo/lp_maxflow_demo.cc
r1610 r1641 23 23 /// the emphasis on the simplicity of the way one can formulate LP 24 24 /// constraints that arise in graph theory in our library LEMON . 25 /// 26 /// \include lp_maxflow_demo.cc 25 27 26 28 #include<lemon/graph_reader.h> -
demo/reader_writer_demo.cc
r1640 r1641 23 23 /// a graph and additional maps (on the nodes or the edges) from/to a 24 24 /// stream. 25 25 /// 26 /// \include reader_writer_demo.cc 26 27 27 28 #include <iostream> -
demo/sub_graph_adaptor_demo.cc
r1636 r1641 22 22 /// This program computes a maximum number of edge-disjoint shortest paths 23 23 /// between nodes \c s and \c t. 24 24 /// 25 /// \include sub_graph_adaptor_demo.cc 25 26 26 27 // Use a DIMACS max flow file as input. -
lemon/smart_graph.h
r1631 r1641 151 151 protected: 152 152 int n; 153 ///\e 154 153 155 ///\todo It should be removed (or at least define a setToId() instead). 154 156 ///
Note: See TracChangeset
for help on using the changeset viewer.