Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::k_shortest_paths_detail::Painting_Within_Max< GT, Distance, Itor, SA > Class Template Reference

A painting of Dijkstra that leaves out the nodes whose distances do not fit, as nodes that the start does not reach, instead of throwing. More...

#include <K_Shortest_Paths.H>

Inheritance diagram for Aleph::k_shortest_paths_detail::Painting_Within_Max< GT, Distance, Itor, SA >:
[legend]
Collaboration diagram for Aleph::k_shortest_paths_detail::Painting_Within_Max< GT, Distance, Itor, SA >:
[legend]

Public Member Functions

 Painting_Within_Max (Distance distance, SA sa)
 A painting with the distance and the filter sa.
 
bool went_beyond_max () const noexcept
 Whether a sum of the last painting went beyond max(), so that it may have left out some node.
 
- Public Member Functions inherited from Aleph::Dijkstra_Min_Paths< GT, Distance, Itor, SA >
 Dijkstra_Min_Paths (Distance dist=Distance(), SA __sa=SA())
 Constructor.
 
GT::Node * compute_min_paths_tree (const GT &g, typename GT::Node *start, GT &tree)
 Computes the spanning tree of all shortest paths from the start node.
 
void compute_partial_min_paths_tree (const GT &g, typename GT::Node *start, typename GT::Node *end, GT &tree)
 Computes the partial spanning tree of all shortest paths from start that contains the path from start to end.
 
bool paint_partial_min_paths_tree (const GT &g, typename GT::Node *start, typename GT::Node *end)
 Paints on graph g the partial shortest paths tree starting from start and stopping when the end node is found.
 
void paint_min_paths_tree (const GT &g, typename GT::Node *start)
 Paints on graph g the spanning tree of all shortest paths starting from start.
 
Distance::Distance_Type find_min_path (const GT &g, typename GT::Node *start, typename GT::Node *end, Path< GT > &min_path)
 Computes the shortest path between start and end by painting the graph.
 
void operator() (const GT &g, typename GT::Node *s, GT &tree)
 Computes the spanning tree of all shortest paths from a given node according to Dijkstra's algorithm.
 
Distance::Distance_Type operator() (const GT &g, typename GT::Node *s, typename GT::Node *e, Path< GT > &path)
 See find_min_path().
 
bool has_computation () const noexcept
 Check if a computation has been performed.
 
bool is_painted () const noexcept
 Check if the graph has been painted.
 
GT::Node * get_start_node () const noexcept
 Get the start node of the last computation.
 
GT * get_graph () const noexcept
 Get the graph of the last computation.
 
Distance::Distance_Type get_distance (typename GT::Node *node)
 Gets the accumulated distance to a node after painting.
 
Distance::Distance_Type get_min_path (typename GT::Node *end, Path< GT > &path)
 Extracts a shortest path to end from a previously painted graph.
 
Distance::Distance_Type get_min_path (const GT &tree, typename GT::Node *end, Path< GT > &path)
 Extracts path from tree to end node.
 
Distance::Distance_Type copy_painted_min_paths_tree (GT &g, GT &tree)
 Extracts the painted shortest paths tree and puts it in tree.
 
- Public Member Functions inherited from Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >
 Shortest_Path_Base (Distance dist=Distance(), SA __sa=SA())
 Default constructor.
 
bool has_computation () const noexcept
 Check if a computation has been performed.
 
bool is_painted () const noexcept
 Check if the graph has been painted.
 
GT::Node * get_start_node () const noexcept
 Get the start node of the last computation.
 
GT * get_graph () const noexcept
 Get the graph of the last computation.
 
Distance::Distance_Type get_distance (typename GT::Node *node)
 Gets the accumulated distance to a node after painting.
 
Distance::Distance_Type get_min_path (typename GT::Node *end, Path< GT > &path)
 Extracts a shortest path to end from a previously painted graph.
 
Distance::Distance_Type copy_painted_min_paths_tree (GT &g, GT &tree)
 Extracts the painted shortest paths tree and puts it in tree.
 
Distance::Distance_Type get_min_path (const GT &tree, typename GT::Node *end, Path< GT > &path)
 Extracts path from tree to end node.
 

Additional Inherited Members

- Public Types inherited from Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >
using Heap = HeapT< GT, Get_Potential_Arc, Heap_Info >
 
- Protected Member Functions inherited from Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >
template<class IN , class IA >
void init (const GT &g, typename GT::Node *start)
 Initialize algorithm state.
 
template<class DN , class DA >
auto uninit_on_exit ()
 Returns a guard that calls uninit() when it goes out of scope.
 
template<class DN , class DA >
void uninit ()
 Cleanup algorithm state.
 
bool add_if_fits (const typename Distance::Distance_Type &a, const typename Distance::Distance_Type &b, typename Distance::Distance_Type &out)
 Adds a tentative distance that may go beyond max().
 
void check_beyond_max (const GT &g, typename GT::Node *start, typename GT::Node *end=nullptr) const
 After a painting in which a sum went beyond max(), throws if a node that start reaches was left out, or end if it is given.
 
Distance::Distance_Type checked_add (const typename Distance::Distance_Type &a, const typename Distance::Distance_Type &b) const
 Checked addition to prevent integer overflow.
 
- Protected Attributes inherited from Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >
SA sa
 Arc filter.
 
Distance distance
 Arc weights.
 
Get_Potential_Arc get_pot
 Potential accessor.
 
Heap heap
 Priority queue.
 
bool painted = false
 Whether graph has been painted.
 
GT * ptr_g = nullptr
 Pointer to the graph.
 
GT::Node * s = nullptr
 Start node.
 
bool beyond_max = false
 A sum of the painting went beyond max()
 
bool leave_out_beyond_max = false
 Whether a painting leaves out without throwing the nodes whose distance does not fit.
 

Detailed Description

template<AlephGraph GT, ArcDistance< GT > Distance, template< typename, class > class Itor, ArcFilter< GT > SA>
class Aleph::k_shortest_paths_detail::Painting_Within_Max< GT, Distance, Itor, SA >

A painting of Dijkstra that leaves out the nodes whose distances do not fit, as nodes that the start does not reach, instead of throwing.

Definition at line 130 of file K_Shortest_Paths.H.

Constructor & Destructor Documentation

◆ Painting_Within_Max()

template<AlephGraph GT, ArcDistance< GT > Distance, template< typename, class > class Itor, ArcFilter< GT > SA>
Aleph::k_shortest_paths_detail::Painting_Within_Max< GT, Distance, Itor, SA >::Painting_Within_Max ( Distance  distance,
SA  sa 
)
inline

A painting with the distance and the filter sa.

Definition at line 134 of file K_Shortest_Paths.H.

References Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >::leave_out_beyond_max.

Member Function Documentation

◆ went_beyond_max()

template<AlephGraph GT, ArcDistance< GT > Distance, template< typename, class > class Itor, ArcFilter< GT > SA>
bool Aleph::k_shortest_paths_detail::Painting_Within_Max< GT, Distance, Itor, SA >::went_beyond_max ( ) const
inlinenoexcept

Whether a sum of the last painting went beyond max(), so that it may have left out some node.

Definition at line 142 of file K_Shortest_Paths.H.

References Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >::beyond_max.

Referenced by Aleph::k_shortest_paths_detail::build_suffix_index_with_itor().


The documentation for this class was generated from the following file: