2
4
2
| ... | ... |
@@ -68,50 +68,50 @@ |
| 68 | 68 |
lemon/dfs.h \ |
| 69 | 69 |
lemon/dijkstra.h \ |
| 70 | 70 |
lemon/dim2.h \ |
| 71 | 71 |
lemon/dimacs.h \ |
| 72 | 72 |
lemon/edge_set.h \ |
| 73 | 73 |
lemon/elevator.h \ |
| 74 | 74 |
lemon/error.h \ |
| 75 | 75 |
lemon/euler.h \ |
| 76 | 76 |
lemon/full_graph.h \ |
| 77 | 77 |
lemon/glpk.h \ |
| 78 | 78 |
lemon/gomory_hu.h \ |
| 79 | 79 |
lemon/graph_to_eps.h \ |
| 80 | 80 |
lemon/grid_graph.h \ |
| 81 | 81 |
lemon/hypercube_graph.h \ |
| 82 | 82 |
lemon/kruskal.h \ |
| 83 | 83 |
lemon/hao_orlin.h \ |
| 84 | 84 |
lemon/lgf_reader.h \ |
| 85 | 85 |
lemon/lgf_writer.h \ |
| 86 | 86 |
lemon/list_graph.h \ |
| 87 | 87 |
lemon/lp.h \ |
| 88 | 88 |
lemon/lp_base.h \ |
| 89 | 89 |
lemon/lp_skeleton.h \ |
| 90 | 90 |
lemon/list_graph.h \ |
| 91 | 91 |
lemon/maps.h \ |
| 92 |
lemon/matching.h \ |
|
| 92 | 93 |
lemon/math.h \ |
| 93 |
lemon/max_matching.h \ |
|
| 94 | 94 |
lemon/min_cost_arborescence.h \ |
| 95 | 95 |
lemon/nauty_reader.h \ |
| 96 | 96 |
lemon/path.h \ |
| 97 | 97 |
lemon/preflow.h \ |
| 98 | 98 |
lemon/radix_sort.h \ |
| 99 | 99 |
lemon/random.h \ |
| 100 | 100 |
lemon/smart_graph.h \ |
| 101 | 101 |
lemon/soplex.h \ |
| 102 | 102 |
lemon/suurballe.h \ |
| 103 | 103 |
lemon/time_measure.h \ |
| 104 | 104 |
lemon/tolerance.h \ |
| 105 | 105 |
lemon/unionfind.h \ |
| 106 | 106 |
lemon/bits/windows.h |
| 107 | 107 |
|
| 108 | 108 |
bits_HEADERS += \ |
| 109 | 109 |
lemon/bits/alteration_notifier.h \ |
| 110 | 110 |
lemon/bits/array_map.h \ |
| 111 | 111 |
lemon/bits/base_extender.h \ |
| 112 | 112 |
lemon/bits/bezier.h \ |
| 113 | 113 |
lemon/bits/default_map.h \ |
| 114 | 114 |
lemon/bits/edge_set_extender.h \ |
| 115 | 115 |
lemon/bits/enable_if.h \ |
| 116 | 116 |
lemon/bits/graph_adaptor_extender.h \ |
| 117 | 117 |
lemon/bits/graph_extender.h \ |
| ... | ... |
@@ -8,49 +8,49 @@ |
| 8 | 8 |
ENDIF(HAVE_GLPK) |
| 9 | 9 |
|
| 10 | 10 |
LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
|
| 11 | 11 |
|
| 12 | 12 |
SET(TESTS |
| 13 | 13 |
adaptors_test |
| 14 | 14 |
bfs_test |
| 15 | 15 |
circulation_test |
| 16 | 16 |
counter_test |
| 17 | 17 |
dfs_test |
| 18 | 18 |
digraph_test |
| 19 | 19 |
dijkstra_test |
| 20 | 20 |
dim_test |
| 21 | 21 |
edge_set_test |
| 22 | 22 |
error_test |
| 23 | 23 |
euler_test |
| 24 | 24 |
gomory_hu_test |
| 25 | 25 |
graph_copy_test |
| 26 | 26 |
graph_test |
| 27 | 27 |
graph_utils_test |
| 28 | 28 |
hao_orlin_test |
| 29 | 29 |
heap_test |
| 30 | 30 |
kruskal_test |
| 31 | 31 |
maps_test |
| 32 |
|
|
| 32 |
matching_test |
|
| 33 | 33 |
min_cost_arborescence_test |
| 34 | 34 |
path_test |
| 35 | 35 |
preflow_test |
| 36 | 36 |
radix_sort_test |
| 37 | 37 |
random_test |
| 38 | 38 |
suurballe_test |
| 39 | 39 |
time_measure_test |
| 40 | 40 |
unionfind_test) |
| 41 | 41 |
|
| 42 | 42 |
IF(HAVE_LP) |
| 43 | 43 |
ADD_EXECUTABLE(lp_test lp_test.cc) |
| 44 | 44 |
IF(HAVE_GLPK) |
| 45 | 45 |
TARGET_LINK_LIBRARIES(lp_test lemon ${GLPK_LIBRARIES})
|
| 46 | 46 |
ENDIF(HAVE_GLPK) |
| 47 | 47 |
ADD_TEST(lp_test lp_test) |
| 48 | 48 |
|
| 49 | 49 |
IF(WIN32 AND HAVE_GLPK) |
| 50 | 50 |
GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION) |
| 51 | 51 |
GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
|
| 52 | 52 |
ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD |
| 53 | 53 |
COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
|
| 54 | 54 |
COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
|
| 55 | 55 |
COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
|
| 56 | 56 |
) |
| ... | ... |
@@ -4,80 +4,80 @@ |
| 4 | 4 |
noinst_HEADERS += \ |
| 5 | 5 |
test/graph_test.h \ |
| 6 | 6 |
test/test_tools.h |
| 7 | 7 |
|
| 8 | 8 |
check_PROGRAMS += \ |
| 9 | 9 |
test/adaptors_test \ |
| 10 | 10 |
test/bfs_test \ |
| 11 | 11 |
test/circulation_test \ |
| 12 | 12 |
test/counter_test \ |
| 13 | 13 |
test/dfs_test \ |
| 14 | 14 |
test/digraph_test \ |
| 15 | 15 |
test/dijkstra_test \ |
| 16 | 16 |
test/dim_test \ |
| 17 | 17 |
test/edge_set_test \ |
| 18 | 18 |
test/error_test \ |
| 19 | 19 |
test/euler_test \ |
| 20 | 20 |
test/gomory_hu_test \ |
| 21 | 21 |
test/graph_copy_test \ |
| 22 | 22 |
test/graph_test \ |
| 23 | 23 |
test/graph_utils_test \ |
| 24 | 24 |
test/hao_orlin_test \ |
| 25 | 25 |
test/heap_test \ |
| 26 | 26 |
test/kruskal_test \ |
| 27 | 27 |
test/maps_test \ |
| 28 |
test/ |
|
| 28 |
test/matching_test \ |
|
| 29 | 29 |
test/min_cost_arborescence_test \ |
| 30 | 30 |
test/path_test \ |
| 31 | 31 |
test/preflow_test \ |
| 32 | 32 |
test/radix_sort_test \ |
| 33 | 33 |
test/random_test \ |
| 34 | 34 |
test/suurballe_test \ |
| 35 | 35 |
test/test_tools_fail \ |
| 36 | 36 |
test/test_tools_pass \ |
| 37 | 37 |
test/time_measure_test \ |
| 38 | 38 |
test/unionfind_test |
| 39 | 39 |
|
| 40 | 40 |
test_test_tools_pass_DEPENDENCIES = demo |
| 41 | 41 |
|
| 42 | 42 |
if HAVE_LP |
| 43 | 43 |
check_PROGRAMS += test/lp_test |
| 44 | 44 |
endif HAVE_LP |
| 45 | 45 |
if HAVE_MIP |
| 46 | 46 |
check_PROGRAMS += test/mip_test |
| 47 | 47 |
endif HAVE_MIP |
| 48 | 48 |
|
| 49 | 49 |
TESTS += $(check_PROGRAMS) |
| 50 | 50 |
XFAIL_TESTS += test/test_tools_fail$(EXEEXT) |
| 51 | 51 |
|
| 52 | 52 |
test_adaptors_test_SOURCES = test/adaptors_test.cc |
| 53 | 53 |
test_bfs_test_SOURCES = test/bfs_test.cc |
| 54 | 54 |
test_circulation_test_SOURCES = test/circulation_test.cc |
| 55 | 55 |
test_counter_test_SOURCES = test/counter_test.cc |
| 56 | 56 |
test_dfs_test_SOURCES = test/dfs_test.cc |
| 57 | 57 |
test_digraph_test_SOURCES = test/digraph_test.cc |
| 58 | 58 |
test_dijkstra_test_SOURCES = test/dijkstra_test.cc |
| 59 | 59 |
test_dim_test_SOURCES = test/dim_test.cc |
| 60 | 60 |
test_edge_set_test_SOURCES = test/edge_set_test.cc |
| 61 | 61 |
test_error_test_SOURCES = test/error_test.cc |
| 62 | 62 |
test_euler_test_SOURCES = test/euler_test.cc |
| 63 | 63 |
test_gomory_hu_test_SOURCES = test/gomory_hu_test.cc |
| 64 | 64 |
test_graph_copy_test_SOURCES = test/graph_copy_test.cc |
| 65 | 65 |
test_graph_test_SOURCES = test/graph_test.cc |
| 66 | 66 |
test_graph_utils_test_SOURCES = test/graph_utils_test.cc |
| 67 | 67 |
test_heap_test_SOURCES = test/heap_test.cc |
| 68 | 68 |
test_kruskal_test_SOURCES = test/kruskal_test.cc |
| 69 | 69 |
test_hao_orlin_test_SOURCES = test/hao_orlin_test.cc |
| 70 | 70 |
test_lp_test_SOURCES = test/lp_test.cc |
| 71 | 71 |
test_maps_test_SOURCES = test/maps_test.cc |
| 72 | 72 |
test_mip_test_SOURCES = test/mip_test.cc |
| 73 |
|
|
| 73 |
test_matching_test_SOURCES = test/matching_test.cc |
|
| 74 | 74 |
test_min_cost_arborescence_test_SOURCES = test/min_cost_arborescence_test.cc |
| 75 | 75 |
test_path_test_SOURCES = test/path_test.cc |
| 76 | 76 |
test_preflow_test_SOURCES = test/preflow_test.cc |
| 77 | 77 |
test_radix_sort_test_SOURCES = test/radix_sort_test.cc |
| 78 | 78 |
test_suurballe_test_SOURCES = test/suurballe_test.cc |
| 79 | 79 |
test_random_test_SOURCES = test/random_test.cc |
| 80 | 80 |
test_test_tools_fail_SOURCES = test/test_tools_fail.cc |
| 81 | 81 |
test_test_tools_pass_SOURCES = test/test_tools_pass.cc |
| 82 | 82 |
test_time_measure_test_SOURCES = test/time_measure_test.cc |
| 83 | 83 |
test_unionfind_test_SOURCES = test/unionfind_test.cc |
| 1 | 1 |
/* -*- mode: C++; indent-tabs-mode: nil; -*- |
| 2 | 2 |
* |
| 3 | 3 |
* This file is a part of LEMON, a generic C++ optimization library. |
| 4 | 4 |
* |
| 5 | 5 |
* Copyright (C) 2003-2009 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#include <iostream> |
| 20 | 20 |
#include <sstream> |
| 21 | 21 |
#include <vector> |
| 22 | 22 |
#include <queue> |
| 23 | 23 |
#include <cstdlib> |
| 24 | 24 |
|
| 25 |
#include <lemon/ |
|
| 25 |
#include <lemon/matching.h> |
|
| 26 | 26 |
#include <lemon/smart_graph.h> |
| 27 | 27 |
#include <lemon/concepts/graph.h> |
| 28 | 28 |
#include <lemon/concepts/maps.h> |
| 29 | 29 |
#include <lemon/lgf_reader.h> |
| 30 | 30 |
#include <lemon/math.h> |
| 31 | 31 |
|
| 32 | 32 |
#include "test_tools.h" |
| 33 | 33 |
|
| 34 | 34 |
using namespace std; |
| 35 | 35 |
using namespace lemon; |
| 36 | 36 |
|
| 37 | 37 |
GRAPH_TYPEDEFS(SmartGraph); |
| 38 | 38 |
|
| 39 | 39 |
|
| 40 | 40 |
const int lgfn = 3; |
| 41 | 41 |
const std::string lgf[lgfn] = {
|
| 42 | 42 |
"@nodes\n" |
| 43 | 43 |
"label\n" |
| 44 | 44 |
"0\n" |
| 45 | 45 |
"1\n" |
| 46 | 46 |
"2\n" |
| 47 | 47 |
"3\n" |
| 48 | 48 |
"4\n" |
| 49 | 49 |
"5\n" |
| ... | ... |
@@ -21,49 +21,49 @@ |
| 21 | 21 |
///\brief DIMACS problem solver. |
| 22 | 22 |
/// |
| 23 | 23 |
/// This program solves various problems given in DIMACS format. |
| 24 | 24 |
/// |
| 25 | 25 |
/// See |
| 26 | 26 |
/// \code |
| 27 | 27 |
/// dimacs-solver --help |
| 28 | 28 |
/// \endcode |
| 29 | 29 |
/// for more info on usage. |
| 30 | 30 |
|
| 31 | 31 |
#include <iostream> |
| 32 | 32 |
#include <fstream> |
| 33 | 33 |
#include <cstring> |
| 34 | 34 |
|
| 35 | 35 |
#include <lemon/smart_graph.h> |
| 36 | 36 |
#include <lemon/dimacs.h> |
| 37 | 37 |
#include <lemon/lgf_writer.h> |
| 38 | 38 |
#include <lemon/time_measure.h> |
| 39 | 39 |
|
| 40 | 40 |
#include <lemon/arg_parser.h> |
| 41 | 41 |
#include <lemon/error.h> |
| 42 | 42 |
|
| 43 | 43 |
#include <lemon/dijkstra.h> |
| 44 | 44 |
#include <lemon/preflow.h> |
| 45 |
#include <lemon/ |
|
| 45 |
#include <lemon/matching.h> |
|
| 46 | 46 |
|
| 47 | 47 |
using namespace lemon; |
| 48 | 48 |
typedef SmartDigraph Digraph; |
| 49 | 49 |
DIGRAPH_TYPEDEFS(Digraph); |
| 50 | 50 |
typedef SmartGraph Graph; |
| 51 | 51 |
|
| 52 | 52 |
template<class Value> |
| 53 | 53 |
void solve_sp(ArgParser &ap, std::istream &is, std::ostream &, |
| 54 | 54 |
DimacsDescriptor &desc) |
| 55 | 55 |
{
|
| 56 | 56 |
bool report = !ap.given("q");
|
| 57 | 57 |
Digraph g; |
| 58 | 58 |
Node s; |
| 59 | 59 |
Digraph::ArcMap<Value> len(g); |
| 60 | 60 |
Timer t; |
| 61 | 61 |
t.restart(); |
| 62 | 62 |
readDimacsSp(is, g, len, s, desc); |
| 63 | 63 |
if(report) std::cerr << "Read the file: " << t << '\n'; |
| 64 | 64 |
t.restart(); |
| 65 | 65 |
Dijkstra<Digraph, Digraph::ArcMap<Value> > dij(g,len); |
| 66 | 66 |
if(report) std::cerr << "Setup Dijkstra class: " << t << '\n'; |
| 67 | 67 |
t.restart(); |
| 68 | 68 |
dij.run(s); |
| 69 | 69 |
if(report) std::cerr << "Run Dijkstra: " << t << '\n'; |
0 comments (0 inline)