crossplatform.ru

Здравствуйте, гость ( Вход | Регистрация )

 
Ответить в данную темуНачать новую тему
> Boost Graph, Алгоритм Беллмана-Форда
barabaka
  опции профиля:
сообщение 6.9.2013, 23:22
Сообщение #1


Студент
*

Группа: Участник
Сообщений: 40
Регистрация: 14.11.2011
Из: Санкт-Петербург
Пользователь №: 2999

Спасибо сказали: 1 раз(а)




Репутация:   2  


Всем привет. Немного введения: скрипт на питоне генерирует рандомный ориентированный граф и записывает в формате graphml. Мне надо прочитать этот граф и реализовать на нём несколько алгоритмов. Алгоритм Беллмана-Форда надо применить, чтобы найти циклы с отрицательной стоимостью и поменять веса рёбер.

Код :
typedef boost::property <boost::vertex_name_t,std::string> VertexProperty;
typedef boost::property <boost::edge_weight_t,int> EdgeProperty;
typedef boost::adjacency_list<boost::vecS,boost::vecS,boost::directedS,VertexProperty,EdgeProperty> DiGraph;

int ReadFromFile(DiGraph &digraph,const std::string &path)
{
  myprint<<"<<<\n";
  int ret = 0;
  std::ifstream file_stream(path.c_str());
  if(file_stream.is_open())
  {
    myprint<<"File "<<path<<" has been opened.\n";
    boost::dynamic_properties dp;
    dp.property("name",boost::get(boost::vertex_name,digraph));
    dp.property("weight",boost::get(boost::edge_weight,digraph));
    try
    {
      read_graphml(file_stream,digraph,dp);
    }
    catch(boost::graph_exception &ge)
    {
      myprint<<ge.what();
      ret = -1;
    }
  }
  myprint<<">>> return "<<ret<<"\n";
  return ret;
};


Граф читается и рёбрам присваиваются веса, доступ к которым можно получить вот так:
typedef typename boost::property_map<DiGraph,boost::edge_weight_t>::type WeightMap;
WeightMap weights = boost::get(boost::edge_weight,digraph);
boost::graph_traits<DiGraph>::edge_iterator edgeIt,edgeEnd;
tie(edgeIt,edgeEnd)=edges(digraph);
for(;edgeIt!=edgeEnd;edgeIt++)
  myprint<<"Edge "<<*edgeIt<<" have weight "<<weights[*edgeIt]<<"\n";


Однако метод Беллмана-Форда не компилируется. Можете помочь мне разобраться в этом?
int RemoveNegativeCostCycles(DiGraph &graph)
{
  myprint<<"<<<\n";
  boost::graph_traits<DiGraph>::vertices_size_type N = num_vertices(graph);
  bool result = boost::bellman_ford_shortest_paths(graph,N);
  myprint<<">>>"<<result<<"\n";
};


То, что выдаёт компилятор (извиняюсь за такое количество текста, файл не прикрепить):
Раскрывающийся текст
mkdir -p debug
g++ -g graphutils.cpp graphml_reader.cpp main.cpp -I. -lboost_graph -o debug/a.out 2>&1
In file included from types.h:10:0,
                 from graphutils.h:4,
                 from graphutils.cpp:1:
/usr/include/boost/graph/bellman_ford_shortest_paths.hpp: In function ‘bool boost::bellman_ford_shortest_paths(EdgeListGraph&, Size, WeightMap, PredecessorMap, DistanceMap, BinaryFunction, BinaryPredicate, BellmanFordVisitor) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, PredecessorMap = boost::dummy_property_map, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, BinaryFunction = boost::closed_plus<boost::detail::error_property_not_found>, BinaryPredicate = std::less<boost::detail::error_property_not_found>, BellmanFordVisitor = boost::bellman_visitor<>]’:

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:187:17:   instantiated from ‘bool boost::detail::bellman_dispatch2(VertexAndEdgeListGraph&, boost::detail::error_property_not_found, Size, WeightMap, PredecessorMap, DistanceMap, const boost::bgl_named_params<P, T, R>&) [with VertexAndEdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, PredecessorMap = boost::dummy_property_map, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, P = int, T = int, R = boost::no_property]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:204:18:   instantiated from ‘bool boost::detail::bellman_dispatch(EdgeListGraph&, Size, WeightMap, DistanceMap, const boost::bgl_named_params<P, T, R>&) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, P = int, T = int, R = boost::no_property]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:217:14:   instantiated from ‘bool boost::bellman_ford_shortest_paths(EdgeListGraph&, Size, const boost::bgl_named_params<P, T, R>&) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, P = int, T = int, R = boost::no_property]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:224:52:   instantiated from ‘bool boost::bellman_ford_shortest_paths(EdgeListGraph&, Size) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int]’

graphutils.cpp:8:52:   instantiated from here

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:124:7: error: no match for call to ‘(boost::closed_plus<boost::detail::error_property_not_found>) (boost::detail::error_property_not_found&, const int&)’

/usr/include/boost/graph/relax.hpp:23:12: note: candidate is:

/usr/include/boost/graph/relax.hpp:30:9: note: T boost::closed_plus<T>::operator()(const T&, const T&) const [with T = boost::detail::error_property_not_found]

/usr/include/boost/graph/relax.hpp:30:9: note:   no known conversion for argument 2 from ‘const int’ to ‘const boost::detail::error_property_not_found&’

In file included from /usr/include/boost/limits.hpp:19:0,
                 from /usr/include/boost/lexical_cast.hpp:33,
                 from /usr/include/boost/graph/graphml.hpp:16,
                 from types.h:7,
                 from graphutils.h:4,
                 from graphutils.cpp:1:

/usr/include/c++/4.6/limits: In static member function ‘static _Tp std::numeric_limits<_Tp>::max() [with _Tp = boost::detail::error_property_not_found]’:

/usr/include/boost/graph/relax.hpp:27:58:   instantiated from ‘boost::closed_plus<T>::closed_plus() [with T = boost::detail::error_property_not_found]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:187:17:   instantiated from ‘bool boost::detail::bellman_dispatch2(VertexAndEdgeListGraph&, boost::detail::error_property_not_found, Size, WeightMap, PredecessorMap, DistanceMap, const boost::bgl_named_params<P, T, R>&) [with VertexAndEdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, PredecessorMap = boost::dummy_property_map, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, P = int, T = int, R = boost::no_property]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:204:18:   instantiated from ‘bool boost::detail::bellman_dispatch(EdgeListGraph&, Size, WeightMap, DistanceMap, const boost::bgl_named_params<P, T, R>&) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, P = int, T = int, R = boost::no_property]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:217:14:   instantiated from ‘bool boost::bellman_ford_shortest_paths(EdgeListGraph&, Size, const boost::bgl_named_params<P, T, R>&) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, P = int, T = int, R = boost::no_property]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:224:52:   instantiated from ‘bool boost::bellman_ford_shortest_paths(EdgeListGraph&, Size) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int]’

graphutils.cpp:8:52:   instantiated from here

/usr/include/c++/4.6/limits:313:48: error: no matching function for call to ‘boost::detail::error_property_not_found::error_property_not_found(int)’

/usr/include/c++/4.6/limits:313:48: note: candidates are:

/usr/include/boost/pending/detail/property.hpp:21:12: note: boost::detail::error_property_not_found::error_property_not_found()

/usr/include/boost/pending/detail/property.hpp:21:12: note:   candidate expects 0 arguments, 1 provided

/usr/include/boost/pending/detail/property.hpp:21:12: note: boost::detail::error_property_not_found::error_property_not_found(const boost::detail::error_property_not_found&)

/usr/include/boost/pending/detail/property.hpp:21:12: note:   no known conversion for argument 1 from ‘int’ to ‘const boost::detail::error_property_not_found&’
In file included from /usr/include/boost/graph/bellman_ford_shortest_paths.hpp:29:0,
                 from types.h:10,
                 from graphutils.h:4,
                 from graphutils.cpp:1:

/usr/include/boost/graph/relax.hpp: In function ‘bool boost::relax(typename boost::graph_traits<Graph>::edge_descriptor, const Graph&, const WeightMap&, PredecessorMap&, DistanceMap&, const BinaryFunction&, const BinaryPredicate&) [with Graph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, PredecessorMap = boost::dummy_property_map, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, BinaryFunction = boost::closed_plus<boost::detail::error_property_not_found>, BinaryPredicate = std::less<boost::detail::error_property_not_found>, typename boost::graph_traits<Graph>::edge_descriptor = boost::detail::edge_desc_impl<boost::directed_tag, unsigned int>]’:

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:113:9:   instantiated from ‘bool boost::bellman_ford_shortest_paths(EdgeListGraph&, Size, WeightMap, PredecessorMap, DistanceMap, BinaryFunction, BinaryPredicate, BellmanFordVisitor) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, PredecessorMap = boost::dummy_property_map, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, BinaryFunction = boost::closed_plus<boost::detail::error_property_not_found>, BinaryPredicate = std::less<boost::detail::error_property_not_found>, BellmanFordVisitor = boost::bellman_visitor<>]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:187:17:   instantiated from ‘bool boost::detail::bellman_dispatch2(VertexAndEdgeListGraph&, boost::detail::error_property_not_found, Size, WeightMap, PredecessorMap, DistanceMap, const boost::bgl_named_params<P, T, R>&) [with VertexAndEdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, PredecessorMap = boost::dummy_property_map, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, P = int, T = int, R = boost::no_property]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:204:18:   instantiated from ‘bool boost::detail::bellman_dispatch(EdgeListGraph&, Size, WeightMap, DistanceMap, const boost::bgl_named_params<P, T, R>&) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, P = int, T = int, R = boost::no_property]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:217:14:   instantiated from ‘bool boost::bellman_ford_shortest_paths(EdgeListGraph&, Size, const boost::bgl_named_params<P, T, R>&) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, P = int, T = int, R = boost::no_property]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:224:52:   instantiated from ‘bool boost::bellman_ford_shortest_paths(EdgeListGraph&, Size) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int]’

graphutils.cpp:8:52:   instantiated from here

/usr/include/boost/graph/relax.hpp:58:7: error: no match for call to ‘(const boost::closed_plus<boost::detail::error_property_not_found>) (D&, W&)’

/usr/include/boost/graph/relax.hpp:23:12: note: candidate is:

/usr/include/boost/graph/relax.hpp:30:9: note: T boost::closed_plus<T>::operator()(const T&, const T&) const [with T = boost::detail::error_property_not_found]

/usr/include/boost/graph/relax.hpp:30:9: note:   no known conversion for argument 2 from ‘W {aka int}’ to ‘const boost::detail::error_property_not_found&’

/usr/include/boost/graph/relax.hpp:59:9: error: no match for call to ‘(const boost::closed_plus<boost::detail::error_property_not_found>) (D&, W&)’

/usr/include/boost/graph/relax.hpp:23:12: note: candidate is:

/usr/include/boost/graph/relax.hpp:30:9: note: T boost::closed_plus<T>::operator()(const T&, const T&) const [with T = boost::detail::error_property_not_found]

/usr/include/boost/graph/relax.hpp:30:9: note:   no known conversion for argument 2 from ‘W {aka int}’ to ‘const boost::detail::error_property_not_found&’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:113:9:   instantiated from ‘bool boost::bellman_ford_shortest_paths(EdgeListGraph&, Size, WeightMap, PredecessorMap, DistanceMap, BinaryFunction, BinaryPredicate, BellmanFordVisitor) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, PredecessorMap = boost::dummy_property_map, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, BinaryFunction = boost::closed_plus<boost::detail::error_property_not_found>, BinaryPredicate = std::less<boost::detail::error_property_not_found>, BellmanFordVisitor = boost::bellman_visitor<>]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:187:17:   instantiated from ‘bool boost::detail::bellman_dispatch2(VertexAndEdgeListGraph&, boost::detail::error_property_not_found, Size, WeightMap, PredecessorMap, DistanceMap, const boost::bgl_named_params<P, T, R>&) [with VertexAndEdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, PredecessorMap = boost::dummy_property_map, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, P = int, T = int, R = boost::no_property]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:204:18:   instantiated from ‘bool boost::detail::bellman_dispatch(EdgeListGraph&, Size, WeightMap, DistanceMap, const boost::bgl_named_params<P, T, R>&) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, P = int, T = int, R = boost::no_property]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:217:14:   instantiated from ‘bool boost::bellman_ford_shortest_paths(EdgeListGraph&, Size, const boost::bgl_named_params<P, T, R>&) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, P = int, T = int, R = boost::no_property]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:224:52:   instantiated from ‘bool boost::bellman_ford_shortest_paths(EdgeListGraph&, Size) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int]’

graphutils.cpp:8:52:   instantiated from here

/usr/include/boost/graph/relax.hpp:62:14: error: no match for call to ‘(const boost::closed_plus<boost::detail::error_property_not_found>) (D&, W&)’

/usr/include/boost/graph/relax.hpp:23:12: note: candidate is:

/usr/include/boost/graph/relax.hpp:30:9: note: T boost::closed_plus<T>::operator()(const T&, const T&) const [with T = boost::detail::error_property_not_found]

/usr/include/boost/graph/relax.hpp:30:9: note:   no known conversion for argument 2 from ‘W {aka int}’ to ‘const boost::detail::error_property_not_found&’

/usr/include/boost/graph/relax.hpp:63:9: error: no match for call to ‘(const boost::closed_plus<boost::detail::error_property_not_found>) (D&, W&)’

/usr/include/boost/graph/relax.hpp:23:12: note: candidate is:

/usr/include/boost/graph/relax.hpp:30:9: note: T boost::closed_plus<T>::operator()(const T&, const T&) const [with T = boost::detail::error_property_not_found]

/usr/include/boost/graph/relax.hpp:30:9: note:   no known conversion for argument 2 from ‘W {aka int}’ to ‘const boost::detail::error_property_not_found&’
In file included from /usr/include/c++/4.6/string:50:0,
                 from /usr/include/c++/4.6/bits/locale_classes.h:42,
                 from /usr/include/c++/4.6/bits/ios_base.h:43,
                 from /usr/include/c++/4.6/ios:43,
                 from /usr/include/c++/4.6/ostream:40,
                 from /usr/include/c++/4.6/iostream:40,
                 from types.h:5,
                 from graphutils.h:4,
                 from graphutils.cpp:1:

/usr/include/c++/4.6/bits/stl_function.h: In member function ‘bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = boost::detail::error_property_not_found]’:

/usr/include/boost/graph/relax.hpp:61:38:   instantiated from ‘bool boost::relax(typename boost::graph_traits<Graph>::edge_descriptor, const Graph&, const WeightMap&, PredecessorMap&, DistanceMap&, const BinaryFunction&, const BinaryPredicate&) [with Graph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, PredecessorMap = boost::dummy_property_map, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, BinaryFunction = boost::closed_plus<boost::detail::error_property_not_found>, BinaryPredicate = std::less<boost::detail::error_property_not_found>, typename boost::graph_traits<Graph>::edge_descriptor = boost::detail::edge_desc_impl<boost::directed_tag, unsigned int>]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:113:9:   instantiated from ‘bool boost::bellman_ford_shortest_paths(EdgeListGraph&, Size, WeightMap, PredecessorMap, DistanceMap, BinaryFunction, BinaryPredicate, BellmanFordVisitor) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, PredecessorMap = boost::dummy_property_map, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, BinaryFunction = boost::closed_plus<boost::detail::error_property_not_found>, BinaryPredicate = std::less<boost::detail::error_property_not_found>, BellmanFordVisitor = boost::bellman_visitor<>]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:187:17:   instantiated from ‘bool boost::detail::bellman_dispatch2(VertexAndEdgeListGraph&, boost::detail::error_property_not_found, Size, WeightMap, PredecessorMap, DistanceMap, const boost::bgl_named_params<P, T, R>&) [with VertexAndEdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, PredecessorMap = boost::dummy_property_map, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, P = int, T = int, R = boost::no_property]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:204:18:   instantiated from ‘bool boost::detail::bellman_dispatch(EdgeListGraph&, Size, WeightMap, DistanceMap, const boost::bgl_named_params<P, T, R>&) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, WeightMap = boost::adj_list_edge_property_map<boost::directed_tag, int, const int&, unsigned int, const boost::property<boost::edge_weight_t, int>, boost::edge_weight_t>, DistanceMap = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >*, boost::detail::error_property_not_found, boost::detail::error_property_not_found&, boost::vertex_distance_t>, P = int, T = int, R = boost::no_property]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:217:14:   instantiated from ‘bool boost::bellman_ford_shortest_paths(EdgeListGraph&, Size, const boost::bgl_named_params<P, T, R>&) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int, P = int, T = int, R = boost::no_property]’

/usr/include/boost/graph/bellman_ford_shortest_paths.hpp:224:52:   instantiated from ‘bool boost::bellman_ford_shortest_paths(EdgeListGraph&, Size) [with EdgeListGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::property<boost::vertex_name_t, std::basic_string<char> >, boost::property<boost::edge_weight_t, int> >, Size = unsigned int]’

graphutils.cpp:8:52:   instantiated from here

/usr/include/c++/4.6/bits/stl_function.h:236:22: error: no match for ‘operator<’ in ‘__x < __y’

/usr/include/c++/4.6/bits/stl_function.h:236:22: note: candidates are:

/usr/include/c++/4.6/bits/stl_pair.h:207:5: note: template<class _T1, class _T2> bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)

/usr/include/c++/4.6/bits/stl_iterator.h:291:5: note: template<class _Iterator> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)

/usr/include/c++/4.6/bits/stl_iterator.h:341:5: note: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::reverse_iterator<_IteratorL>&, const std::reverse_iterator<_IteratorR>&)

/usr/include/c++/4.6/bits/basic_string.h:2510:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::basic_string<_CharT, _Traits, _Alloc>&, const std::basic_string<_CharT, _Traits, _Alloc>&)

/usr/include/c++/4.6/bits/basic_string.h:2522:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)

/usr/include/c++/4.6/bits/basic_string.h:2534:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const std::basic_string<_CharT, _Traits, _Alloc>&)

/usr/include/c++/4.6/bits/stl_tree.h:866:5: note: template<class _Key, class _Val, class _KeyOfValue, class _Compare, class _Alloc> bool std::operator<(const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&, const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&)

/usr/include/c++/4.6/bits/stl_map.h:899:5: note: template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator<(const std::map<_Key, _Tp, _Compare, _Alloc>&, const std::map<_Key, _Tp, _Compare, _Alloc>&)

/usr/include/c++/4.6/bits/stl_multimap.h:817:5: note: template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator<(const std::multimap<_Key, _Tp, _Compare, _Alloc>&, const std::multimap<_Key, _Tp, _Compare, _Alloc>&)

/usr/include/c++/4.6/bits/stl_vector.h:1290:5: note: template<class _Tp, class _Alloc> bool std::operator<(const std::vector<_Tp, _Alloc>&, const std::vector<_Tp, _Alloc>&)

/usr/include/c++/4.6/bits/stl_list.h:1593:5: note: template<class _Tp, class _Alloc> bool std::operator<(const std::list<_Tp, _Alloc>&, const std::list<_Tp, _Alloc>&)

/usr/include/c++/4.6/bits/stl_set.h:713:5: note: template<class _Key, class _Compare, class _Alloc> bool std::operator<(const std::set<_Key, _Compare, _Alloc>&, const std::set<_Key, _Compare, _Alloc>&)

/usr/include/c++/4.6/bits/stl_multiset.h:696:5: note: template<class _Key, class _Compare, class _Alloc> bool std::operator<(const std::multiset<_Key, _Compare, _Alloc>&, const std::multiset<_Key, _Compare, _Alloc>&)

/usr/include/c++/4.6/bits/stl_deque.h:272:5: note: template<class _Tp, class _Ref, class _Ptr> bool std::operator<(const std::_Deque_iterator<_Tp, _Ref, _Ptr>&, const std::_Deque_iterator<_Tp, _Ref, _Ptr>&)

/usr/include/c++/4.6/bits/stl_deque.h:280:5: note: template<class _Tp, class _RefL, class _PtrL, class _RefR, class _PtrR> bool std::operator<(const std::_Deque_iterator<_Tp, _RefL, _PtrL>&, const std::_Deque_iterator<_Tp, _RefR, _PtrR>&)

/usr/include/c++/4.6/bits/stl_deque.h:1935:5: note: template<class _Tp, class _Alloc> bool std::operator<(const std::deque<T, A>&, const std::deque<T, A>&)

/usr/include/c++/4.6/bits/stl_stack.h:259:5: note: template<class _Tp, class _Seq> bool std::operator<(const std::stack<_Tp, _Seq>&, const std::stack<_Tp, _Seq>&)

/usr/include/boost/graph/detail/edge.hpp:71:5: note: template<class D, class V> bool boost::detail::operator<(const boost::detail::edge_desc_impl<D, V>&, const boost::detail::edge_desc_impl<D, V>&)


Сообщение отредактировал Litkevich Yuriy - 8.9.2013, 17:30
Перейти в начало страницы
 
Быстрая цитата+Цитировать сообщение

Быстрый ответОтветить в данную темуНачать новую тему
Теги
Нет тегов для показа


1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0




RSS Текстовая версия Сейчас: 19.10.2019, 0:59