graph_analysis
Public Member Functions | List of all members
graph_analysis::BipartiteGraph Class Reference

Implementation of a bipartite graph, that consists of a set of 'blue' nodes and of 'red' nodes. More...

#include <BipartiteGraph.hpp>

Public Member Functions

 BipartiteGraph ()
 
void linkVertices (const Vertex::Ptr &red, const Vertex::Ptr &blue, const std::string &label="")
 
std::vector< Vertex::Ptr > getPartners (const Vertex::Ptr &vertex) const
 
Vertex::Ptr getUniquePartner (const Vertex::Ptr &vertex) const
 
SubGraph::Ptr getRedSubGraph () const
 
SubGraph::Ptr getBlueSubGraph () const
 

Detailed Description

Implementation of a bipartite graph, that consists of a set of 'blue' nodes and of 'red' nodes.

For the implementation a general graph will store all vertices and edges, while the two set of blue and red vertices will be identified through two corresponding SubGraph instances

Constructor & Destructor Documentation

◆ BipartiteGraph()

graph_analysis::BipartiteGraph::BipartiteGraph ( )

Member Function Documentation

◆ getBlueSubGraph()

SubGraph::Ptr graph_analysis::BipartiteGraph::getBlueSubGraph ( ) const
inline

Get the subgraph that contains only blue vertices

Returns
SubGraph

◆ getPartners()

std::vector< Vertex::Ptr > graph_analysis::BipartiteGraph::getPartners ( const Vertex::Ptr &  vertex) const

Get all vertex partner, i.e. vertices

◆ getRedSubGraph()

SubGraph::Ptr graph_analysis::BipartiteGraph::getRedSubGraph ( ) const
inline

Get the subgraph that contains only red vertices

Returns
SubGraph

◆ getUniquePartner()

Vertex::Ptr graph_analysis::BipartiteGraph::getUniquePartner ( const Vertex::Ptr &  vertex) const

Retrieve the single partner

Exceptions
ifthere are more partner than 1

◆ linkVertices()

void graph_analysis::BipartiteGraph::linkVertices ( const Vertex::Ptr &  red,
const Vertex::Ptr &  blue,
const std::string &  label = "" 
)

Link two vertices – vertices will be added to the corresponding subsets

Parameters
redVertex that belongs to the red set
blueVertex that belongs to the blue set
labelLabel that will be set on the edge(s) added to the graph

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