CXXGraph  0.4.0
CXXGraph is a header only, that manages the Graphs and it's algorithm in C++
PartitioningStats.hpp
1 /***********************************************************/
2 /*** ______ ____ ______ _ ***/
3 /*** / ___\ \/ /\ \/ / ___|_ __ __ _ _ __ | |__ ***/
4 /*** | | \ / \ / | _| '__/ _` | '_ \| '_ \ ***/
5 /*** | |___ / \ / \ |_| | | | (_| | |_) | | | | ***/
6 /*** \____/_/\_\/_/\_\____|_| \__,_| .__/|_| |_| ***/
7 /*** |_| ***/
8 /***********************************************************/
9 /*** Header-Only C++ Library for Graph ***/
10 /*** Representation and Algorithms ***/
11 /***********************************************************/
12 /*** Author: ZigRazor ***/
13 /*** E-Mail: zigrazor@gmail.com ***/
14 /***********************************************************/
15 /*** Collaboration: ----------- ***/
16 /***********************************************************/
17 /*** License: AGPL v3.0 ***/
18 /***********************************************************/
19 
20 #ifndef __CXXGRAPH_PARTITIONINGSTATS_H__
21 #define __CXXGRAPH_PARTITIONINGSTATS_H__
22 
23 #include <iostream>
24 #include "Utility/Typedef.hpp"
25 namespace CXXGRAPH
26 {
27  namespace PARTITIONING
28  {
30  {
31  public:
32  unsigned int numberOfPartitions = 0; // The number of Partitions
33  unsigned int numberOfNodes = 0; // The number of Nodes
34  unsigned int replicatedNodesCount = 0; // The number of Nodes that are replicated
35  unsigned int numberOfEdges = 0; // The number of edges
36  unsigned int replicatedEdgesCount = 0; // The number of edges that are replicated
37  unsigned int maxEdgesLoad = 0; // Maximum edges load of the partitions
38  unsigned int minEdgesLoad = 0; // Minimun edges load of the partitions
39  unsigned int maxNodesLoad = 0; // Maximum nodes load of the partitions
40  unsigned int minNodesLoad = 0; // Minimun nodes load of the partitions
41  double balanceEdgesFactor = 0.0; // The balance edges factor of the partitions (maxEdgesLoad - minEdgesLoad) / (maxEdgesLoad), 0 is the optimal partitioning
42  double balanceNodesFactor = 0.0; // The balance edges factor of the partitions (maxNodesLoad - minNodesLoad) / (maxNodesLoad), 0 is the optimal partitioning
43  double nodesReplicationFactor = 0.0; // The replication factor of the Nodes (replicatedNodesCount / numberOfNodes), 1 is the optimal partitioning
44  double edgesReplicationFactor = 0.0; // The replication factor of the edges (replicatedEdgesCount / numberOfEdges), 1 is the optimal partitioning
45 
46  friend std::ostream &operator<<(std::ostream &os, const PartitioningStats &partitionStats)
47  {
48  os << "Partitioning Stats:\n";
49  os << "\tNumber of Partitions: " << partitionStats.numberOfPartitions << "\n";
50  os << "\tNumber of Nodes: " << partitionStats.numberOfNodes << "\n";
51  os << "\tNumber of Edges: " << partitionStats.numberOfEdges << "\n";
52  os << "\tNumber of Nodes Replica: " << partitionStats.replicatedNodesCount << "\n";
53  os << "\tNumber of Edges Replica: " << partitionStats.replicatedEdgesCount << "\n";
54  os << "\tNodes Replication Factor: " << partitionStats.nodesReplicationFactor << "\n";
55  os << "\tEdges Replication Factor: " << partitionStats.edgesReplicationFactor << "\n";
56  os << "\tMax Edges Load: " << partitionStats.maxEdgesLoad << "\n";
57  os << "\tMin Edges Load: " << partitionStats.minEdgesLoad << "\n";
58  os << "\tBalance Edges Factor: " << partitionStats.balanceEdgesFactor << "\n";
59  os << "\tMax Nodes Load: " << partitionStats.maxNodesLoad << "\n";
60  os << "\tMin Nodes Load: " << partitionStats.minNodesLoad << "\n";
61  os << "\tBalance Nodes Factor: " << partitionStats.balanceNodesFactor << "\n";
62  return os;
63  }
64  };
65  }
66 
67 }
68 
69 #endif // __CXXGRAPH_PARTITIONINGSTATS_H__
Definition: PartitioningStats.hpp:30