Hello,
I am trying to run the metric_tsp_approx.cpp example, but I get an error, I am using the suggested data 3 vertices data, I don't know what I am doing wrong, please help.
Vicky.
http://www.boost.org/doc/libs/1_58_0/libs/graph/test/metric_tsp_approx.cpp
$more graph.txt
1,2
20,4
15,7
I get this error:
terminate called after throwing an instance of 'boost::exception_detail::clone_implboost::negative_edge >'
what(): The graph may not contain an edge with negative weight.
Aborted (core dumped)
Its after all the graph is connected:
we can parse the given file
Opened file
1,2
20,4
15,7
Closed file
(1,2) -> (20,4) = 19.105
(1,2) -> (15,7) = 14.8661
(20,4) -> (15,7) = 5.83095
Conected all
terminate called after throwing an instance of 'boost::exception_detail::clone_implboost::negative_edge >'
what(): The graph may not contain an edge with negative weight.
Aborted (core dumped)
This is what I get when doing a backtrace: (shortened)
(gdb) bt
#0 0x00007ffff722bcc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff722f0d8 in __GI_abort () at abort.c:89
#2 0x00007ffff7b36535 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff7b346d6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff7b34703 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff7b34922 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00000000004085c8 in boost::throw_exceptionboost::negative_edge (e=...) at /usr/include/boost/throw_exception.hpp:67
#7 0x0000000000408b0f in examine_edge