Skip to content

Commit

Permalink
closes #49 - connectedness
Browse files Browse the repository at this point in the history
  • Loading branch information
oxy86 committed Aug 4, 2017
1 parent 5ef0b77 commit 29a0f4a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Graph::Graph() {
m_graphDensity = -1;
fileName ="";

calculatedGraphConnectedness = false;
calculatedGraphReciprocity = false;
calculatedGraphSymmetry = false;
calculatedGraphWeighted = false;
Expand Down Expand Up @@ -316,6 +317,7 @@ void Graph::clear() {
m_symmetric=true;
m_graphDensity = -1;

calculatedGraphConnectedness = false;
calculatedGraphReciprocity = false;
calculatedGraphSymmetry = false;
calculatedGraphWeighted = false;
Expand Down Expand Up @@ -3737,7 +3739,7 @@ int Graph::graphConnectedness(const bool updateProgress) {

qDebug() << "Graph::graphConnectedness() ";

if (calculatedDistances && !graphModified()) {
if (calculatedGraphConnectedness && !graphModified()) {
qDebug()<< "Graph::graphConnectedness() - graph unmodified. Returning:"
<< m_graphConnectedness;
return m_graphConnectedness;
Expand Down Expand Up @@ -3854,6 +3856,8 @@ int Graph::graphConnectedness(const bool updateProgress) {
if (updateProgress) {
emit signalProgressBoxKill();
}

calculatedGraphConnectedness = true;
return m_graphConnectedness;
}

Expand Down Expand Up @@ -13517,14 +13521,15 @@ void Graph::graphSave(const QString &fileName,
};
if (saved) {
if (graphModified()) {
calculatedGraphConnectedness = false;
calculatedGraphReciprocity = false;
calculatedGraphSymmetry = false;
calculatedGraphWeighted = false;
calculatedGraphDensity = false;
calculatedEdges = false;
calculatedVertices = false;
calculatedVerticesList=false;
calculatedVerticesSet = false;
calculatedGraphReciprocity = false;
calculatedGraphSymmetry = false;
calculatedIsolates = false;
calculatedAdjacencyMatrix = false;
calculatedDistances = false;
Expand Down Expand Up @@ -19707,15 +19712,14 @@ void Graph::layoutForceDirectedKamadaKawai(const int maxIterations,


// initialize p1, p2, ... pn
// placing the particles on the vertices of a regular n-polygon
// circumscribed by a circle whose diameter is L0

qDebug()<< "Graph::layoutForceDirectedKamadaKawai() - "
"Set particles to initial positions p" ;
i=0;
x0=canvasWidth/2.0;
y0=canvasHeight/2.0;

// placing the particles on the vertices of a regular n-polygon
// circumscribed by a circle whose diameter is L0
//layoutCircular(x0,y0,L0/2,false);
layoutRandom();

Expand Down
1 change: 1 addition & 0 deletions src/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ public slots:
bool calculatedTriad;
bool calculatedGraphSymmetry, calculatedGraphReciprocity;
bool calculatedGraphDensity, calculatedGraphWeighted;
bool calculatedGraphConnectedness;
bool m_undirected, m_symmetric, m_isWeighted;

QString VERSION, fileName, m_graphName, initEdgeColor, initVertexColor,
Expand Down

0 comments on commit 29a0f4a

Please sign in to comment.