CXXGraph  0.1.3
CXXGraph is a small library, header only, that manages the Graph and it's algorithm in C++
Public Member Functions | List of all members
CXXGRAPH::Partition< T > Class Template Reference
Inheritance diagram for CXXGRAPH::Partition< T >:
Inheritance graph
[legend]
Collaboration diagram for CXXGRAPH::Partition< T >:
Collaboration graph
[legend]

Public Member Functions

 Partition (unsigned int partitionId)
 
 Partition (const std::list< const Edge< T > * > &edgeSet)
 
 Partition (unsigned int partitionId, const std::list< const Edge< T > * > &edgeSet)
 
unsigned int getPartitionId () const
 Get the Partition ID. More...
 
void setPartitionId (unsigned int partitionId)
 Set the Partition ID. More...
 
- Public Member Functions inherited from CXXGRAPH::Graph< T >
 Graph (const std::list< const Edge< T > * > &edgeSet)
 
const std::list< const Edge< T > * > & getEdgeSet () const
 
void setEdgeSet (std::list< const Edge< T > * > &edgeSet)
 
void addEdge (const Edge< T > *edge)
 
void removeEdge (unsigned long edgeId)
 
const std::list< const Node< T > * > getNodeSet () const
 
const std::optional< const Edge< T > * > getEdge (unsigned long edgeId) const
 
const AdjacencyMatrix< T > getAdjMatrix () const
 This function generate a list of adjacency matrix with every element of the matrix contain the node where is directed the link and the Edge corrispondent to the link.
 
const DijkstraResult dijkstra (const Node< T > &source, const Node< T > &target) const
 Function runs the dijkstra algorithm for some source node and target node in the graph and returns the shortest distance of target from the source. More...
 
const std::vector< Node< T > > breadth_first_search (const Node< T > &start) const
 Function performs the breadth first search algorithm over the graph. More...
 
const std::vector< Node< T > > depth_first_search (const Node< T > &start) const
 Function performs the depth first search algorithm over the graph. More...
 
bool isCyclicDirectedGraphDFS () const
 This function uses DFS to check for cycle in the graph. Pay Attention, this function work only with directed Graph. More...
 
bool isCyclicDirectedGraphBFS () const
 This function uses BFS to check for cycle in the graph. Pay Attention, this function work only with directed Graph. More...
 
bool isDirectedGraph () const
 This function checks if a graph is directed. More...
 
int writeToFile (InputOutputFormat format=InputOutputFormat::STANDARD_CSV, const std::string &workingDir=".", const std::string &OFileName="graph", bool compress=false, bool writeNodeFeat=false, bool writeEdgeWeight=false) const
 This function write the graph in an output file. More...
 
int readFromFile (InputOutputFormat format=InputOutputFormat::STANDARD_CSV, const std::string &workingDir=".", const std::string &OFileName="graph", bool compress=false, bool readNodeFeat=false, bool readEdgeWeight=false)
 This function write the graph in an output file. More...
 
PartitionMap< T > partitionGraph (PartitionAlgorithm algorithm, unsigned int numberOfPartitions) const
 This function partition a graph in a set of partitions. More...
 

Additional Inherited Members

- Public Types inherited from CXXGRAPH::Graph< T >
enum  E_InputOutputFormat { STANDARD_CSV , STANDARD_TSV , OUT_1 , OUT_2 }
 Specify the Input/Output format of the Graph for Import/Export functions. More...
 
enum  E_PartitionAlgorithm { GREEDY_VC , ALG_1 , ALG_2 }
 Specify the Partition Algorithm. More...
 
typedef enum CXXGRAPH::Graph::E_InputOutputFormat InputOutputFormat
 Specify the Input/Output format of the Graph for Import/Export functions.
 
typedef enum CXXGRAPH::Graph::E_PartitionAlgorithm PartitionAlgorithm
 Specify the Partition Algorithm.
 

Member Function Documentation

◆ getPartitionId()

template<typename T >
unsigned int CXXGRAPH::Partition< T >::getPartitionId

Get the Partition ID.

Returns
The ID of the partition

◆ setPartitionId()

template<typename T >
void CXXGRAPH::Partition< T >::setPartitionId ( unsigned int  partitionId)

Set the Partition ID.

Parameters
partitionIdthe ID to set

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