Changeset 1583:2b329fd595ef in lemon-0.x for demo
- Timestamp:
- 07/22/05 17:15:29 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2085
- Location:
- demo
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
demo/dijkstra_demo.cc
r1530 r1583 1 /* -*- C++ -*- 2 * demo/lp_maxflow_demo.cc - Part of LEMON, a generic C++ optimization library 3 * 4 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 5 * (Egervary Research Group on Combinatorial Optimization, EGRES). 6 * 7 * Permission to use, modify and distribute this software is granted 8 * provided that this copyright notice appears in all copies. For 9 * precise terms see the accompanying LICENSE file. 10 * 11 * This software is provided "AS IS" with no warranty of any kind, 12 * express or implied, and with no claim as to its suitability for any 13 * purpose. 14 * 15 */ 16 17 ///\ingroup demos 18 ///\file 19 ///\brief Demonstrating LEMON implementation of the Dijkstra algorithm 20 /// 21 /// Dijkstra's algorithm computes shortest paths between two nodes in 22 /// a graph with edge lengths. Here we only show some of the 23 /// facilities supplied by our implementation: for the detailed 24 /// documentation of the LEMON Dijkstra class read \ref lemon::Dijkstra "this". 25 1 26 #include <iostream> 2 27 … … 52 77 std::cout << "The id of s is " << g.id(s)<< ", the id of t is " << g.id(t)<<"."<<std::endl; 53 78 54 std::cout << "Dijkstra algorithm test..." << std::endl;79 std::cout << "Dijkstra algorithm demo..." << std::endl; 55 80 56 81 -
demo/hello_lemon.cc
r1530 r1583 1 /* -*- C++ -*- 2 * demo/lp_maxflow_demo.cc - Part of LEMON, a generic C++ optimization library 3 * 4 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 5 * (Egervary Research Group on Combinatorial Optimization, EGRES). 6 * 7 * Permission to use, modify and distribute this software is granted 8 * provided that this copyright notice appears in all copies. For 9 * precise terms see the accompanying LICENSE file. 10 * 11 * This software is provided "AS IS" with no warranty of any kind, 12 * express or implied, and with no claim as to its suitability for any 13 * purpose. 14 * 15 */ 16 17 ///\ingroup demos 18 ///\file 19 ///\brief LEMON style "Hello World!" program 20 /// 21 /// This program is intended to be a "Hello World!" program that shows 22 /// the very basic notions of the LEMON library: \ref graphs "graphs" and 23 /// \ref maps-page "maps". Click on the links to read more about these. 24 1 25 #include <iostream> 2 26 #include <lemon/list_graph.h> -
demo/kruskal_demo.cc
r1580 r1583 19 19 ///\brief Minimum weight spanning tree by Kruskal algorithm (demo). 20 20 /// 21 /// This demo program shows how to find a minimum weight spannintree22 /// ofa graph by using the Kruskal algorithm.21 /// This demo program shows how to find a minimum weight spanning tree 22 /// in a graph by using the Kruskal algorithm. 23 23 24 24 #include <iostream> -
demo/lp_maxflow_demo.cc
r1577 r1583 19 19 ///\brief Max flow problem solved with an LP solver (demo). 20 20 /// 21 /// This demo program shows how to solve a maximum (or maximal) flow22 /// problem using the LEMON LP solver interface. We would like to lay23 /// the emphasis on the simplicity of the way one can formulate the LP24 /// constraints with LEMON that arise in graph theory.21 /// This demo program shows how to solve a maximum (or maximal) flow 22 /// problem using the LEMON LP solver interface. We would like to lay 23 /// the emphasis on the simplicity of the way one can formulate LP 24 /// constraints that arise in graph theory in our library LEMON . 25 25 26 26 #ifdef HAVE_CONFIG_H -
demo/reader_writer_demo.cc
r1534 r1583 1 /* -*- C++ -*- 2 * demo/lp_maxflow_demo.cc - Part of LEMON, a generic C++ optimization library 3 * 4 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 5 * (Egervary Research Group on Combinatorial Optimization, EGRES). 6 * 7 * Permission to use, modify and distribute this software is granted 8 * provided that this copyright notice appears in all copies. For 9 * precise terms see the accompanying LICENSE file. 10 * 11 * This software is provided "AS IS" with no warranty of any kind, 12 * express or implied, and with no claim as to its suitability for any 13 * purpose. 14 * 15 */ 16 17 ///\ingroup demos 18 ///\file 19 ///\brief Demonstrating graph input and output 20 /// 21 /// This simple demo program gives an example of how to read and write 22 /// a graph and additional maps (on the nodes or the edges) from/to a 23 /// stream. 24 25 1 26 #include <iostream> 2 27 #include <lemon/smart_graph.h> … … 19 44 20 45 std::cout << "Hello! We have read a graph from file " << filename<< 21 " and some maps on it: now we write thisto the standard output!" <<46 " and some maps on it:\n now we write it to the standard output!" << 22 47 std::endl; 23 48 -
demo/sub_graph_adaptor_demo.cc
r1577 r1583 1 // -*- c++ -*- 1 /* -*- C++ -*- 2 * demo/lp_maxflow_demo.cc - Part of LEMON, a generic C++ optimization library 3 * 4 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 5 * (Egervary Research Group on Combinatorial Optimization, EGRES). 6 * 7 * Permission to use, modify and distribute this software is granted 8 * provided that this copyright notice appears in all copies. For 9 * precise terms see the accompanying LICENSE file. 10 * 11 * This software is provided "AS IS" with no warranty of any kind, 12 * express or implied, and with no claim as to its suitability for any 13 * purpose. 14 * 15 */ 16 17 ///\ingroup demos 18 ///\file 19 ///\brief Computing maximum number of edge-disjoint shortest paths 20 /// 21 /// This program computes a maximum number of edge-disjoint shortest paths 22 /// between nodes \c s and \c t. 23 2 24 3 25 // Use a DIMACS max flow file as input. 4 26 // sub_graph_adaptor_demo < dimacs_max_flow_file 5 // This program computes a maximum number of edge-disjoint shortest paths6 // between s and t. 27 // Modified to eat lemon graph format! 28 7 29 8 30 #include <iostream> … … 17 39 #include <tight_edge_filter_map.h> 18 40 41 #include <lemon/graph_reader.h> 19 42 20 21 //#include <lemon/graph_reader.h>22 //#include <lemon/graph_writer.h>23 43 24 44 using namespace lemon; … … 31 51 if(argc<2) 32 52 { 33 std::cerr << "USAGE: sub_graph_adaptor_demo input_file.dim" << std::endl; 34 std::cerr << "The file 'input_file.dim' has to contain a max flow instance in DIMACS format (e.g. sub_graph_adaptor_demo.dim is such a file)." << std::endl; 53 std::cerr << "USAGE: sub_graph_adaptor_demo input_file.lgf" << std::endl; 54 std::cerr << "The file 'input_file.lgf' has to contain a max flow " 55 << "instance in \n LEMON format " 56 << "(e.g. sub_gad_input.lgf is such a file)." 57 << std::endl; 35 58 return 0; 36 59 } … … 52 75 LengthMap length(g); 53 76 54 readDimacs(is, g, length, s, t);77 //readDimacs(is, g, length, s, t); 55 78 56 // GraphWriter<SmartGraph> writer(std::cout, g);57 // writer.writeEdgeMap("length", length);58 // writer.writeNode("source",s);59 // writer.writeNode("target",t);60 // writer.run();61 79 62 // GraphReader<ListGraph> reader(is,g);63 //reader.readNode("source",s).readNode("target",t)64 //.readEdgeMap("length",length).run();80 GraphReader<SmartGraph> reader(is,g); 81 reader.readNode("source",s).readNode("target",t) 82 .readEdgeMap("length",length).run(); 65 83 66 84 cout << "edges with lengths (of form id, source--length->target): " << endl;
Note: See TracChangeset
for help on using the changeset viewer.