P4C
The P4 Compiler
Loading...
Searching...
No Matches
Reachability< Graph > Class Template Reference

#include <boost_graph.h>

Public Types

using EdgeSet
 
using Vertex = typename Graph::vertex_descriptor
 

Public Member Functions

 Reachability (const Graph &g)
 
bool canReach (Vertex v1, Vertex v2)
 Determines whether vertex v2 is reachable from the vertex v1.
 
void clear ()
 
bitvec reachableBetween (Vertex v1, Vertex v2)
 
void setSink (std::optional< Vertex > sink)
 Sets the sink node; no nodes will be considered reachable from this node.
 

Detailed Description

template<class Graph>
class Reachability< Graph >

Graph reachability via the Floyd-Warshall algorithm. Absent cycles, vertices are not considered reachable from themselves.

Member Typedef Documentation

◆ EdgeSet

template<class Graph >
using Reachability< Graph >::EdgeSet
Initial value:
typename boost::container_gen<typename Graph::vertex_list_selector, bitvec>::type

Member Function Documentation

◆ clear()

template<class Graph >
void Reachability< Graph >::clear ( )
inline

Clears reachability information so that it gets recomputed the next time canReach is called. This should be called at least once whenever the underlying graph changes after any call to canReach.

◆ reachableBetween()

template<class Graph >
bitvec Reachability< Graph >::reachableBetween ( Vertex v1,
Vertex v2 )
inline
Returns
a bitvec representing all vertices that are reachable from v1 and can reach v2.