428 \code |
428 \code |
429 typedef TightEdgeFilterMap<Graph, const Dijkstra::DistMap, LengthMap> |
429 typedef TightEdgeFilterMap<Graph, const Dijkstra::DistMap, LengthMap> |
430 TightEdgeFilter; |
430 TightEdgeFilter; |
431 TightEdgeFilter tight_edge_filter(g, dijkstra.distMap(), length); |
431 TightEdgeFilter tight_edge_filter(g, dijkstra.distMap(), length); |
432 |
432 |
433 ConstMap<Node, bool> const_true_map(true); |
433 typedef EdgeSubGraphWrapper<Graph, TightEdgeFilter> SubGW; |
434 typedef SubGraphWrapper<Graph, ConstMap<Node, bool>, TightEdgeFilter> SubGW; |
434 SubGW gw(g, tight_edge_filter); |
435 SubGW gw(g, const_true_map, tight_edge_filter); |
|
436 \endcode |
435 \endcode |
437 Then, the maximum nimber of edge-disjoint \c s-\c t paths are computed |
436 Then, the maximum nimber of edge-disjoint \c s-\c t paths are computed |
438 with a max flow algorithm Preflow. |
437 with a max flow algorithm Preflow. |
439 \code |
438 \code |
440 ConstMap<Edge, int> const_1_map(1); |
439 ConstMap<Edge, int> const_1_map(1); |
669 |
668 |
670 // KEEP_MAPS(Parent, SubGraphWrapper); |
669 // KEEP_MAPS(Parent, SubGraphWrapper); |
671 }; |
670 }; |
672 |
671 |
673 |
672 |
|
673 /*! \brief A wrapper for hiding edges from a graph. |
|
674 |
|
675 \warning Graph wrappers are in even more experimental state than the other |
|
676 parts of the lib. Use them at you own risk. |
|
677 |
|
678 A wrapper for hiding edges from a graph. |
|
679 This wrapper specializes SubGraphWrapper in the way that only the edge-set |
|
680 can be filtered. |
|
681 \author Marton Makai |
|
682 */ |
|
683 template<typename Graph, typename EdgeFilterMap> |
|
684 class EdgeSubGraphWrapper : |
|
685 public SubGraphWrapper<Graph, ConstMap<typename Graph::Node,bool>, |
|
686 EdgeFilterMap> { |
|
687 public: |
|
688 typedef SubGraphWrapper<Graph, ConstMap<typename Graph::Node,bool>, |
|
689 EdgeFilterMap> Parent; |
|
690 protected: |
|
691 ConstMap<typename Graph::Node, bool> const_true_map; |
|
692 public: |
|
693 EdgeSubGraphWrapper(Graph& _graph, EdgeFilterMap& _edge_filter_map) : |
|
694 Parent(), const_true_map(true) { |
|
695 Parent::setGraph(_graph); |
|
696 Parent::setNodeFilterMap(const_true_map); |
|
697 Parent::setEdgeFilterMap(_edge_filter_map); |
|
698 } |
|
699 }; |
|
700 |
674 |
701 |
675 template<typename Graph> |
702 template<typename Graph> |
676 class UndirGraphWrapper : public GraphWrapper<Graph> { |
703 class UndirGraphWrapper : public GraphWrapper<Graph> { |
677 public: |
704 public: |
678 typedef GraphWrapper<Graph> Parent; |
705 typedef GraphWrapper<Graph> Parent; |