diff --git a/include/boost/graph/uniform_cost_search.hpp b/include/boost/graph/uniform_cost_search.hpp deleted file mode 100644 index 2d18f0aa..00000000 --- a/include/boost/graph/uniform_cost_search.hpp +++ /dev/null @@ -1,231 +0,0 @@ -// -//======================================================================= -// Copyright 1997, 1998, 1999, 2000 University of Notre Dame. -// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek -// -// This file is part of the Boost Graph Library -// -// You should have received a copy of the License Agreement for the -// Boost Graph Library along with the software; see the file LICENSE. -// If not, contact Office of Research, University of Notre Dame, Notre -// Dame, IN 46556. -// -// Permission to modify the code and to distribute modified code is -// granted, provided the text of this NOTICE is retained, a notice that -// the code was modified is included with the above COPYRIGHT NOTICE and -// with the COPYRIGHT NOTICE in the LICENSE file, and that the LICENSE -// file is distributed with the modified code. -// -// LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. -// By way of example, but not limitation, Licensor MAKES NO -// REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY -// PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE COMPONENTS -// OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS -// OR OTHER RIGHTS. -//======================================================================= -// -#ifndef BOOST_GRAPH_UNIFORM_COST_SEARCH_HPP -#define BOOST_GRAPH_UNIFORM_COST_SEARCH_HPP - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace boost { - - template - struct UniformCostVisitorConcept { - void constraints() { - function_requires< CopyConstructibleConcept >(); - vis.initialize_vertex(u, g); - vis.discover_vertex(u, g); - vis.examine_vertex(u, g); - vis.examine_edge(e, g); - vis.edge_relaxed(e, g); - vis.edge_not_relaxed(e, g); - vis.finish_vertex(u, g); - } - Visitor vis; - Graph g; - typename graph_traits::vertex_descriptor u; - typename graph_traits::edge_descriptor e; - }; - - template - class ucs_visitor : public bfs_visitor { - public: - ucs_visitor(Visitors vis = Visitors()) : bfs_visitor(vis) { } - - template - void edge_relaxed(Edge e, Graph& g) { - invoke_visitors(m_vis, e, g, on_edge_relaxed()); - } - template - void edge_not_relaxed(Edge e, Graph& g) { - invoke_visitors(m_vis, e, g, on_edge_not_relaxed()); - } - private: - template - void tree_edge(Edge u, Graph& g) { } - }; - template - ucs_visitor - make_ucs_visitor(Visitors vis) { - return ucs_visitor(vis); - } - - // Variant (1) - template - inline void - uniform_cost_search(VertexListGraph& g, - typename graph_traits::vertex_descriptor s, - BinaryPredicate compare, BinaryFunction combine) - { - typedef typename graph_traits::edge_descriptor Edge; - typedef typename graph_traits::vertex_descriptor V; - uniform_cost_search(g, s, get(vertex_distance, G), - get(edge_weight, G), compare, combine); - } - - // Variant (2) - template - inline void - uniform_cost_search(VertexListGraph& g, - typename graph_traits::vertex_descriptor s, - DistanceMap d, WeightMap w, - BinaryPredicate compare, BinaryFunction combine) - { - null_visitor null_vis; - uniform_cost_search(g, s, d, w, - get(vertex_color, g), get(vertex_index, g), - compare, combine, make_ucs_visitor(null_vis)); - } - - namespace detail { - template - struct ucs_bfs_visitor { - ucs_bfs_visitor(UniformCostVisitor vis, UpdatableQueue& Q, - WeightMap w, DistanceMap d, - BinaryFunction combine, BinaryPredicate compare) - : m_vis(vis), m_Q(Q), m_weight(w), m_distance(d), - m_combine(combine), m_compare(compare) { } - - template - void initialize_vertex(Vertex u, Graph& g) { - m_vis.initialize_vertex(u, g); - } - template - void discover_vertex(Vertex u, Graph& g) { - m_vis.discover_vertex(u, g); - } - template - void examine_vertex(Vertex u, Graph& g) { - m_vis.examine_vertex(u, g); - } - template - void examine_edge(Edge e, Graph& g) { - m_vis.examine_edge(e, g); - } - template - void tree_edge(Edge e, Graph& g) { - m_decreased = relax(e, g, m_weight, m_distance, - m_combine, m_compare); - if (m_decreased) { - m_vis.edge_relaxed(e, g); - put(m_predecessor, target(e, g), source(e, g)); - } else - m_vis.edge_not_relaxed(e, g); - } - template - void non_tree_edge(Edge, Graph&) { } - - template - void gray_target(Edge e, Graph& g) { - m_decreased = relax(e, g, m_weight, m_distance, - m_combine, m_compare); - if (m_decreased) { - m_Q.update(target(e, g)); - m_vis.edge_relaxed(e, g); - } else - m_vis.edge_not_relaxed(e, g); - } - template - void black_target(Edge, Graph&) { } - - template - void finish_vertex(Vertex u, Graph& g) { - m_vis.finish_vertex(u, g); - } - UniformCostVisitor m_vis; - UpdatableQueue& m_Q; - WeightMap m_weight; - PredecessorMap m_predecessor; - DistanceMap m_distance; - BinaryFunction m_combine; - BinaryPredicate m_compare; - bool m_decreased; - }; - } // namespace detail - - // Variant (3) - template - void - uniform_cost_search(VertexListGraph& g, - typename graph_traits::vertex_descriptor s, - DistanceMap d, WeightMap w, ColorMap color, IndexMap id, - BinaryPredicate compare, BinaryFunction combine, - UniformCostVisitor vis) - { - function_requires >(); - typedef typename graph_traits::vertex_descriptor Vertex; - typedef typename graph_traits::edge_descriptor Edge; - function_requires >(); - function_requires >(); - function_requires >(); - function_requires >(); - typedef typename property_traits::value_type D_value; - typedef typename property_traits::value_type W_value; - typedef typename property_traits::value_type ID_value; - typedef typename property_traits::value_type Color_value; - function_requires >(); - function_requires >(); - function_requires >(); - function_requires >(); - function_requires >(); - - typedef indirect_cmp IndirectCmp; - IndirectCmp icmp(d, compare); - - typedef mutable_queue, IndirectCmp, IndexMap> - MutableQueue; - - MutableQueue Q(num_vertices(g), icmp, id); - - detail::ucs_bfs_visitor - bfs_vis(vis, Q, w, d, combine, compare); - - breadth_first_search(g, s, buffer(Q).visitor(bfs_vis).color_map(color)); - } - - -} // namespace boost - -#endif // BOOST_GRAPH_UNIFORM_COST_SEARCH_HPP