GraphLibrary  0.0.1
A simple library that implements various graph algorithms.
 All Classes Namespaces Files Functions Variables Typedefs Macros
gl::interface Namespace Reference

Functions

template<class GRAPH >
std::function< std::pair< bool,
gl::Color >const
gl::index_type src, const
gl::index_type dest)> 
getEdgeSelectorFromGraph (const GRAPH &graph, const gl::Color &trueColor=gl::Color("red"), const gl::Color &falseColor=gl::Color("black"))
 Provides a Selector Object to color the edges in a given Graph. More...
 
template<class PATH >
std::function< std::pair< bool,
gl::Color >const
gl::index_type src, const
gl::index_type dest)> 
getEdgeSelectorFromPath (const PATH &path, const gl::Color &trueColor=gl::Color("red"), const gl::Color &falseColor=gl::Color("black"))
 Provides a Selector Object to color the edges in a given Path. More...
 
template<class SHORTEST_PATH_ALGORITHM >
std::function< std::pair< bool,
gl::Color >const
gl::index_type src, const
gl::index_type dest)> 
getEdgeSelectorFromShortestPath (SHORTEST_PATH_ALGORITHM &spa, const gl::index_type pathSource, const gl::index_type pathDest, const gl::Color &trueColor=gl::Color("red"), const gl::Color &falseColor=gl::Color("black"))
 Provides a Selector Object to color the edges in a Shortest Path. More...
 
template<class SHORTEST_PATH_ALGORITHM >
std::function< std::pair< bool,
gl::Color >const
gl::index_type src, const
gl::index_type dest)> 
getEdgeSelectorFromShortestPathTree (SHORTEST_PATH_ALGORITHM &spa, const gl::index_type treeSource, const gl::Color &trueColor=gl::Color("red"), const gl::Color &falseColor=gl::Color("black"))
 Provides a Selector Object to color the edges in a Shortest Path Tree. More...
 
template<class PATH >
std::function< std::pair< bool,
gl::Color >const
gl::index_type node)> 
getNodeSelectorFromPath (const PATH &path, const gl::Color &trueColor=gl::Color("red"), const gl::Color &falseColor=gl::Color("white"))
 Provides a Selector Object to color the nodes in a given Path. More...
 
template<class SHORTEST_PATH_ALGORITHM >
std::function< std::pair< bool,
gl::Color >const
gl::index_type node)> 
getNodeSelectorFromShortestPath (SHORTEST_PATH_ALGORITHM &spa, const gl::index_type pathSource, const gl::index_type pathDest, const gl::Color &trueColor=gl::Color("red"), const gl::Color &falseColor=gl::Color("white"))
 Provides a Selector Object to color the nodes in a Shortest Path. More...
 
template<class SHORTEST_PATH_ALGORITHM >
std::function< std::pair< bool,
gl::Color >const
gl::index_type node)> 
getNodeSelectorFromShortestPathTree (SHORTEST_PATH_ALGORITHM &spa, const gl::index_type treeSource, const gl::Color &trueColor=gl::Color("red"), const gl::Color &falseColor=gl::Color("white"))
 Provides a Selector Object to color the nodes in a Shortest Path Tree. More...
 
template<class GRAPH , class EDGE_SELECTOR >
void colorFlaggedEdges (GRAPH &graph, EDGE_SELECTOR &&selector)
 Colors edges selectively using a selector function. More...
 
template<class GRAPH , class NODE_SELECTOR >
void colorFlaggedNodes (GRAPH &graph, NODE_SELECTOR &&selector)
 Colors nodes selectively using a selector function. More...
 
template<class GRAPH , class EDGE_SELECTOR , class NODE_SELECTOR >
void colorFlaggedEntities (GRAPH &graph, EDGE_SELECTOR &&edge_selector, NODE_SELECTOR &&node_selector)
 Colors nodes & edges selectively using a selector function. More...
 

Function Documentation

template<class GRAPH >
std::function<std::pair<bool,gl::Color>const gl::index_type src, const gl::index_type dest)> gl::interface::getEdgeSelectorFromGraph ( const GRAPH &  graph,
const gl::Color trueColor = gl::Color("red"),
const gl::Color falseColor = gl::Color("black") 
)

Provides a Selector Object to color the edges in a given Graph.

Template Parameters
GRAPHSome Graph type
Parameters
[in]graphGraph that contains edges that are to be colored
[in]trueColor(optional) New color for the graph edges.
[in]falseColor(optional) New color for all non-graph edges.
Returns
Selector Object: std::pair<bool,gl::Color>
template<class PATH >
std::function<std::pair<bool,gl::Color>const gl::index_type src, const gl::index_type dest)> gl::interface::getEdgeSelectorFromPath ( const PATH &  path,
const gl::Color trueColor = gl::Color("red"),
const gl::Color falseColor = gl::Color("black") 
)

Provides a Selector Object to color the edges in a given Path.

Template Parameters
PATHstd::pair<bool,typename Graph::idx_list_t>. A Path type whose first element contains a boolean value that states path existence, and the second pair element contains a vector of node IDs in the shortest path.
Parameters
[in]pathPath of edges and nodes
[in]trueColor(optional) New color for the path edges.
[in]falseColor(optional) New color for all non-path edges.
Returns
Selector Object: std::pair<bool,gl::Color>
template<class SHORTEST_PATH_ALGORITHM >
std::function<std::pair<bool,gl::Color>const gl::index_type src, const gl::index_type dest)> gl::interface::getEdgeSelectorFromShortestPath ( SHORTEST_PATH_ALGORITHM &  spa,
const gl::index_type  pathSource,
const gl::index_type  pathDest,
const gl::Color trueColor = gl::Color("red"),
const gl::Color falseColor = gl::Color("black") 
)

Provides a Selector Object to color the edges in a Shortest Path.

Template Parameters
SHORTEST_PATH_ALGORITHMShortest Path Algorithm that supports a call to getPath(src,dest) that returns an std::pair<bool,typename Graph::idx_list_t> whose first element contains a boolean value that states path existence, and the second pair element contains a vector of node IDs in the shortest path.
Parameters
[in]spaShortest Path Algorithm (e.g. FloydWarshall, Dijkstra)
[in]pathSourceStart of the shortest path
[in]pathDestEnd of the shortest path
[in]trueColor(optional) New color for the SP edges.
[in]falseColor(optional) New color for all non-SP edges.
Returns
Selector Object: std::pair<bool,gl::Color>
template<class SHORTEST_PATH_ALGORITHM >
std::function<std::pair<bool,gl::Color>const gl::index_type src, const gl::index_type dest)> gl::interface::getEdgeSelectorFromShortestPathTree ( SHORTEST_PATH_ALGORITHM &  spa,
const gl::index_type  treeSource,
const gl::Color trueColor = gl::Color("red"),
const gl::Color falseColor = gl::Color("black") 
)

Provides a Selector Object to color the edges in a Shortest Path Tree.

Template Parameters
SHORTEST_PATH_ALGORITHMShortest Path Algorithm that supports a call to getPath(src,dest) that returns an std::pair<bool,typename Graph::idx_list_t> whose first element contains a boolean value that states path existence, and the second pair element contains a vector of node IDs in the shortest path.
Parameters
[in]spaShortest Path Algorithm (e.g. FloydWarshall, Dijkstra)
[in]treeSourceSource of the shortest path tree
[in]trueColor(optional) New color for the SPT edges.
[in]falseColor(optional) New color for all non-SPT edges.
Returns
Selector Object: std::pair<bool,gl::Color>
template<class PATH >
std::function<std::pair<bool,gl::Color>const gl::index_type node)> gl::interface::getNodeSelectorFromPath ( const PATH &  path,
const gl::Color trueColor = gl::Color("red"),
const gl::Color falseColor = gl::Color("white") 
)

Provides a Selector Object to color the nodes in a given Path.

Template Parameters
PATHstd::pair<bool,typename Graph::idx_list_t>. A Path type whose first element contains a boolean value that states path existence, and the second pair element contains a vector of node IDs in the shortest path.
Parameters
[in]pathPath of edges and nodes
[in]trueColor(optional) New color for the path nodes.
[in]falseColor(optional) New color for all non-path nodes.
Returns
Selector Object: std::pair<bool,gl::Color>
template<class SHORTEST_PATH_ALGORITHM >
std::function<std::pair<bool,gl::Color>const gl::index_type node)> gl::interface::getNodeSelectorFromShortestPath ( SHORTEST_PATH_ALGORITHM &  spa,
const gl::index_type  pathSource,
const gl::index_type  pathDest,
const gl::Color trueColor = gl::Color("red"),
const gl::Color falseColor = gl::Color("white") 
)

Provides a Selector Object to color the nodes in a Shortest Path.

Template Parameters
SHORTEST_PATH_ALGORITHMShortest Path Algorithm that supports a call to getPath(src,dest) that returns an std::pair<bool,typename Graph::idx_list_t> whose first element contains a boolean value that states path existence, and the second pair element contains a vector of node IDs in the shortest path.
Parameters
[in]spaShortest Path Algorithm (e.g. FloydWarshall, Dijkstra)
[in]pathSourceStart of the shortest path
[in]pathDestEnd of the shortest path
[in]trueColor(optional) New color for the SP nodes.
[in]falseColor(optional) New color for all non-SP nodes.
Returns
Selector Object: std::pair<bool,gl::Color>
template<class SHORTEST_PATH_ALGORITHM >
std::function<std::pair<bool,gl::Color>const gl::index_type node)> gl::interface::getNodeSelectorFromShortestPathTree ( SHORTEST_PATH_ALGORITHM &  spa,
const gl::index_type  treeSource,
const gl::Color trueColor = gl::Color("red"),
const gl::Color falseColor = gl::Color("white") 
)

Provides a Selector Object to color the nodes in a Shortest Path Tree.

Template Parameters
SHORTEST_PATH_ALGORITHMShortest Path Algorithm that supports a call to getPath(src,dest) that returns an std::pair<bool,typename Graph::idx_list_t> whose first element contains a boolean value that states path existence, and the second pair element contains a vector of node IDs in the shortest path.
Parameters
[in]spaShortest Path Algorithm (e.g. FloydWarshall, Dijkstra)
[in]treeSourceSource of the shortest path tree
[in]trueColor(optional) New color for the SPT nodes.
[in]falseColor(optional) New color for all non-SPT nodes.
Returns
Selector Object: std::pair<bool,gl::Color>
template<class GRAPH , class EDGE_SELECTOR >
void gl::interface::colorFlaggedEdges ( GRAPH &  graph,
EDGE_SELECTOR &&  selector 
)

Colors edges selectively using a selector function.

Template Parameters
GRAPHGraph Object.
EDGE_SELECTORSelector Object: Colors exactly those edges that are "selected".
Parameters
[in]graphReference to graph that needs to be modified.
[in]selectorReference to selector object
template<class GRAPH , class NODE_SELECTOR >
void gl::interface::colorFlaggedNodes ( GRAPH &  graph,
NODE_SELECTOR &&  selector 
)

Colors nodes selectively using a selector function.

Template Parameters
GRAPHGraph Object.
NODE_SELECTORSelector Object: Colors exactly those nodes that are "selected".
Parameters
[in]graphReference to graph that needs to be modified.
[in]selectorReference to selector object
template<class GRAPH , class EDGE_SELECTOR , class NODE_SELECTOR >
void gl::interface::colorFlaggedEntities ( GRAPH &  graph,
EDGE_SELECTOR &&  edge_selector,
NODE_SELECTOR &&  node_selector 
)

Colors nodes & edges selectively using a selector function.

Template Parameters
GRAPHGraph Object.
EDGE_SELECTORSelector Object: Colors exactly those edges that are "selected".
NODE_SELECTORSelector Object: Colors exactly those nodes that are "selected".
Parameters
[in]graphReference to graph that needs to be modified.
[in]edge_selectorReference to selector object for edges
[in]node_selectorReference to selector object for nodes