The Graph class This is the main class for a Graph, used in conjuction with Vertex, Parser and Matrix objects. Graph class methods are the interface to various analysis algorithms Vertex class holds each vertex data (colors, strings, statistics, etc) Matrix class holds the adjacency matrix of the network. Parser class loads files of networks. More...

#include <graph.h>

Inheritance diagram for Graph:
Collaboration diagram for Graph:

Public Slots

int relationCurrent ()
 Returns current relation index. More...
 
QString relationCurrentName () const
 Returns current relation. More...
 
void relationCurrentRename (const QString &newName, const bool &notifyMW=false)
 Graph::relationCurrentRename. More...
 
void vertexCreate (const int &num, const int &size, const QString &nodeColor, const QString &numColor, const int &numSize, const QString &label, const QString &lColor, const int &labelSize, const QPointF &p, const QString &nodeShape, const bool &signalMW)
 Graph::vertexCreate Main vertex creation slot, associated with homonymous signal from Parser. Adds a Vertex to the Graph and calls editNodeAdd of GraphicsWidget The new Vertex is named i and stores its color, label, label color, shape and position p. p holds the desired position of the new node. More...
 
void graphFileLoaded (const int &fileType, const QString &fName=QString::null, const QString &netName=QString::null, const int &totalNodes=0, const int &totalLinks=0, const bool &undirected=false, const QString &message=QString::null)
 Graph::graphFileLoaded Updates MW with the loaded file type (0=nofile, 1=Pajek, 2=Adjacency etc) Called from Parser on file parsing end or file error. More...
 
void vertexRemoveDummyNode (int)
 Deletes any dymmy nodes This is called from loadPajek method of Parser in order to delete any redundant (dummy) nodes. More...
 
void graphLoadedTerminateParserThreads (QString reason)
 Graph::graphLoadedTerminateParserThreads. More...
 
void edgeCreate (const int &v1, const int &v2, const float &weight, const QString &color, const int &type=0, const bool &drawArrows=true, const bool &bezier=false, const QString &label=QString::null, const bool &signalMW=true)
 Graph::edgeCreate Checks if edge exists, and if the opposite edge exists Calls edgeAdd to add the new edge to the Graph, then emits drawEdge() which calls GraphicsWidget::drawEdge() to draw the new edge. Called from homonymous signal of Parser class. Also called from MW when user clicks on the "add link" button Also called (via MW) from GW when user middle-clicks on two nodes. More...
 
void edgeCreateWebCrawler (const int &source, const int &target)
 Graph::edgeCreateWebCrawler Called from WebCrawler when it finds an new link Calls edgeCreate() method with initEdgeColor. More...
 
void edgeVisibilitySet (int relation, int, int, bool)
 Graph::edgeVisibilitySet Changes the canvas visibility of an edge Called from Vertex when edgeFilterByWeight is called. More...
 
void vertexCreateAtPos (const QPointF &p)
 Graph::vertexCreateAtPos. More...
 
void vertexCreateAtPosRandom (const bool &signalMW=false)
 Graph::vertexCreateAtPosRandom. More...
 
void vertexCreateAtPosRandomWithLabel (const int &i, const QString &label, const bool &signalMW=false)
 Graph::vertexCreateAtPosRandomWithLabel. More...
 
void relationSet (int index=RAND_MAX, const bool notifyMW=true)
 Graph::relationSet Changes m_curRelation to index. If index==RAND_MAX, changes to last added relation. Then calls Vertex::relationSet() for all enabled vertices, to disable edges of the old relation and enable edges of the new relation Then, if notifyMW==TRUE, it signals signalRelationChangedToGW(int), which disables/enables the on screen edges, and Called from MW when the user selects a relation in the combo box. Also called from Parser. More...
 
void relationNext ()
 Graph::slotEditRelationNext Increases the index of editRelationChangeCombo which signals to Graph::relationSet() More...
 
void relationPrev ()
 Graph::slotEditRelationPrev Decreases the index of editRelationChangeCombo which signals to Graph::relationSet() More...
 
void canvasSizeSet (const int w, const int h)
 Graph::canvasSizeSet Called when MW and GraphicsWidget resizes to update canvasWidth and canvasHeight. More...
 
double canvasMaxRadius () const
 Graph::canvasMaxRadius. More...
 
float canvasMinDimension () const
 Graph::canvasMinDimension. More...
 
double canvasVisibleX (const double &x) const
 Graph::canvasVisibleX. More...
 
double canvasVisibleY (const double &y) const
 Graph::canvasVisibleY. More...
 
double canvasRandomX () const
 Graph::canvasRandomX. More...
 
double canvasRandomY () const
 Graph::canvasRandomY. More...
 
void vertexIsolateFilter (bool)
 Graph::vertexIsolateFilter Called from filterOrphanNodes via MainWindow to filter nodes with no links For each orphan Vertex in the Graph, emits the filterVertex() More...
 
void vertexClickedSet (const int &v)
 Graph::vertexClickedSet. More...
 
void edgeClickedSet (const int &v1, const int &v2)
 Graph::vertexClickedSet. More...
 
void edgeFilterByWeight (float, bool)
 Graph::edgeFilterByWeight Called from MW::DialogEdgeFilter to filter edges over or under a specified weight (m_threshold). For each Vertex in the Graph, calls the homonymous method of Vertex class. More...
 
void edgeFilterByRelation (int relation, bool status)
 Graph::edgeFilterByRelation Filter out all edges of a given relation Calls the homonymous method of Vertex class. More...
 
void edgeFilterUnilateral (const bool &toggle)
 Graph::edgeFilterUnilateral Filters (enables/disables) unilateral edges in current relationship. If toggle=true, all non-reciprocal edges are disabled, effectively making the network symmetric. More...
 
void webCrawl (QString, int, int, bool extLinks, bool intLinks)
 
QString htmlEscaped (QString str) const
 Helper method, returns a nice qstring where all html special chars are encoded. More...
 

Signals

void updateProgressDialog (int)
 
void signalGraphModified (const int &graphStatus, const bool &undirected, const int &vertices, const int &edges, const float &density)
 
void signalGraphLoaded (const int &fileType, const QString &fileName=QString::null, const QString &netName=QString::null, const int &totalNodes=0, const int &totalLinks=0, const QString &message=QString::null)
 
void signalGraphSaved (const int &status)
 
void statusMessage (const QString &message)
 
void signalDatasetDescription (QString)
 
void signalNodeSizesByOutDegree (bool)
 
void signalNodeSizesByInDegree (bool)
 
void signalNodeClickedInfo (const int &number=0, const QPointF &p=QPointF(), const QString &label=QString::null, const int &inDegree=0, const int &outDegree=0, const float &clc=0)
 
void signalEdgeClickedInfo (const long int &v1=0, const long int &v2=0, const float &weight=0, const bool &undirected=false)
 
void signalRelationAddToMW (const QString &newRelation, const bool &changeRelation=true)
 
void signalRelationsClear ()
 
void signalRelationRenamedToMW (const QString newRelName)
 
void signalRelationChangedToGW (int)
 
void signalRelationChangedToMW (const int &relIndex=RAND_MAX)
 
void signalSelectionChanged (const int &selectedVertices, const int &selectedEdges)
 
void drawNode (const int &num, const int &size, const QString &nodeShape, const QString &nodeColor, const bool &showNumbers, const bool &numbersInside, const QString &numberColor, const int &numSize, const int &numDistance, const bool &showLabels, const QString &label, const QString &labelColor, const int &labelSize, const int &labelDistance, const QPointF &p)
 
void eraseNode (long int)
 
void drawEdge (const int &v1, const int &v2, const float &weight, const QString &label="", const QString &color="black", const int &type=0, const bool arrows=true, const bool &bezier=false, const bool &weightNumbers=false)
 
void eraseEdge (const long int &, const long int &)
 
void setEdgeVisibility (int, int, int, bool)
 
void setVertexVisibility (long int, bool)
 
void setNodePos (const int &, const qreal &, const qreal &)
 
void setNodeSize (const long int &v, const int &size)
 
void setNodeShape (const long int v, const QString &shape)
 
void setNodeColor (const long int v, const QString &color)
 
void setNodeLabel (long int, QString)
 
void setNodeNumberSize (const long int &, const int &)
 
void setNodeNumberDistance (const long int &, const int &)
 
void setNodeLabelSize (const long int &, const int &)
 
void setNodeLabelColor (const long int &, const QString &color)
 
void setNodeLabelDistance (const long int &, const int &)
 
void setEdgeWeight (const long int &v1, const long int &v2, const float &weight)
 
void setEdgeUndirected (const long int &v1, const long int &v2, const float &weight)
 
void setEdgeColor (const long int &v1, const long int &v2, const QString &color)
 
void setEdgeLabel (const long int &v1, const long int &v2, const QString &label)
 
void addGuideCircle (const double &, const double &, const double &)
 
void addGuideHLine (const double &y0)
 
void operateSpider ()
 

Public Member Functions

 Graph ()
 Graph::Graph constructor. More...
 
void clear ()
 
 ~Graph ()
 Graph::~Graph. More...
 
void setSocNetV_Version (QString ver)
 
QString graphName () const
 Graph::graphName If m_graphName is set on file loading, it returns that. If m_graphName is empty, then returns current relation name If m_graphName is empty and there is no current relation name, then returns "noname". More...
 
void graphLoad (const QString m_fileName, const QString m_codecName, const bool m_showLabels, const int format, const int two_sm_mode, const QString delimiter=QString::null)
 Graph::graphLoad Our almost universal network loader. :) It creates a new Parser object, moves it to a another thread, connects signals and slots and calls its run() method. More...
 
void graphSave (const QString &fileName, const int &fileType, const bool &saveEdgeWeights=true)
 Graph::graphSave Our almost universal graph saver. :) Actually it just checks the requested file type and calls the right saveGraphTo...() method. More...
 
bool graphSaveToPajekFormat (const QString &fileName, QString networkName="", int maxWidth=0, int maxHeight=0)
 
bool graphSaveToAdjacencyFormat (const QString &fileName, const bool &saveEdgeWeights=true)
 Graph::graphSaveToAdjacencyFormat. More...
 
bool graphSaveToGraphMLFormat (const QString &fileName, QString networkName="", int maxWidth=0, int maxHeight=0)
 
bool graphSaveToDotFormat (QString fileName)
 
int graphFileFormat () const
 graphFileFormat More...
 
bool graphFileFormatExportSupported (const int &fileFormat) const
 Graph::graphFileFormatExportSupported. More...
 
QString graphMatrixTypeToString (const int &matrixType) const
 Helper method, return the human readable name of matrix type. More...
 
int graphMatrixStrToType (const QString &matrix) const
 Helper method, return the matrix type of human readable matrix name . More...
 
QString graphMetricTypeToString (const int &metricType) const
 Helper method, return the human readable name of metric type. More...
 
int graphMetricStrToType (const QString &metricStr) const
 Helper method, return the identifier of a metric. More...
 
QString graphClusteringMethodTypeToString (const int &methodType) const
 Helper method, return the human readable name of clustering method type. More...
 
int graphClusteringMethodStrToType (const QString &method) const
 Helper method, return clustering method type from the human readable name of it. More...
 
int relations ()
 Graph::relations. More...
 
void relationsClear ()
 Graph::relationsClear. More...
 
void relationAdd (const QString &relName, const bool &changeRelation=false)
 Graph::relationAdd Adds a new relation named relName Called by file parser to add a new relation Also called from MW. emits signalRelationAddToMW. More...
 
int vertexNumberMax ()
 Graph::vertexNumberMax Returns the name of the last vertex. Used by slotEditNodeRemove of MW. More...
 
int vertexNumberMin ()
 Graph::vertexNumberMin Returns the name of the first vertex. Used by slotRemoveNode of MW. More...
 
int vertexDegreeOut (int)
 Graph::vertexDegreeOut Returns the outDegree (sum of outbound edge weights) of vertex v1. More...
 
int vertexDegreeIn (int)
 Graph::vertexDegreeIn Returns the inDegree (sum of inbound edge weights) of vertex v1. More...
 
QList< int > vertexNeighborhoodList (const int &v1)
 Graph::vertexNeighborhoodList. More...
 
bool vertexIsolated (const long int &v1) const
 Graph::vertexIsolated. More...
 
int vertexExists (const long int &v1)
 Graph::vertexExists Checks if there is a specific vertex in the graph. Returns the index or -1 Complexity: O(logN) for index retrieval. More...
 
int vertexExists (const QString &label)
 Graph::vertexExists Checks if there is a vertex with a specific label in the graph Returns the index or -1 Complexity: O(N) More...
 
void vertexRemove (long int)
 Graph::vertexRemove Removes the vertex named Doomed from the graph First, it removes all edges to Doomed from other vertices Then it changes the index of all subsequent vertices inside m_graph Finally, it removes the vertex. More...
 
void vertexSizeInit (const long int)
 Graph::vertexSizeInit Initialization function. More...
 
void vertexSizeSet (const long int &v, const int &newsize)
 Graph::vertexSizeSet Changes the size.of vertex v Called from MW Node Properties. More...
 
void vertexSizeAllSet (const int newsize)
 Graph::vertexSizeAllSet Changes the size.of all vertices. More...
 
int vertexSize (const long int &v)
 Graph::vertexSize. More...
 
void vertexShapeInit (const QString)
 Graph::vertexShapeInit. More...
 
void vertexShapeSet (const int v, const QString shape)
 Graph::vertexShapeSet Changes the shape.of vertex v. More...
 
void vertexShapeAllSet (const QString shape)
 Graph::vertexShapeAllSet Changes the shape.of all vertices. More...
 
QString vertexShape (const int &v)
 Graph::vertexShape Returns the shape of this vertex. More...
 
void vertexColorInit (const QString &color)
 Graph::vertexColorInit default vertex color initialization. More...
 
void vertexColorSet (const long &v, const QString &color)
 Graph::vertexColorSet Changes the color of vertex v1. More...
 
void vertexColorAllSet (const QString &color)
 Graph::vertexColorAllSet Changes the color of all vertices and updates default vertex color. More...
 
QColor vertexColor (const long int &v)
 Graph::vertexColor. More...
 
void vertexNumberColorInit (QString color)
 Graph::vertexNumberColorInit Changes the initial color of vertices numbers. More...
 
void vertexNumberSizeInit (const int &size)
 Graph::vertexNumberSizeInit Changes the initial size of vertices numbers. More...
 
void vertexNumberSizeSet (const long int &v, const int &newsize)
 Graph::vertexNumberSizeSet Changes the size.of vertex v number. More...
 
void vertexNumberSizeSetAll (const int &size)
 Graph::vertexNumberSizeSetAll. More...
 
void vertexNumberDistanceInit (const int &distance)
 
void vertexNumberDistanceSet (const long int &v, const int &newDistance)
 Graph::vertexNumberDistanceSet Changes the distance.of vertex v number from the vertex. More...
 
void vertexNumberDistanceSetAll (const int &newDistance)
 Graph::vertexNumberDistanceSetAll Changes the distance.of all vertex number from their vertices. More...
 
void vertexNumbersInsideNodesSet (bool toggle)
 Graph::vertexNumbersInsideNodesSet. More...
 
void vertexNumbersVisibilitySet (bool toggle)
 Graph::vertexNumbersVisibilitySet. More...
 
void vertexLabelsVisibilitySet (bool toggle)
 Graph::vertexLabelsVisibilitySet. More...
 
void vertexLabelSizeInit (int newSize)
 Graph::vertexLabelSizeInit Changes the default size of vertex labels. More...
 
void vertexLabelSizeSet (const long int &v, const int &newsize)
 Graph::vertexLabelSizeSet Changes the label size of vertex v1. More...
 
void vertexLabelSizeAllSet (const int &)
 Graph::vertexLabelSizeAllSet Changes the label size of all vertices. More...
 
void vertexLabelColorInit (QString color)
 Graph::vertexLabelColorInit Changes the default vertex label color. More...
 
void vertexLabelSet (int v, QString label)
 Graph::vertexLabelSet Changes the label of a vertex v1. More...
 
void vertexLabelColorSet (int v1, QString color)
 Graph::vertexLabelColorSet Changes the label color of vertex v1. More...
 
void vertexLabelColorAllSet (const QString &color)
 Graph::vertexLabelColorAllSet Changes the label color of all vertices. More...
 
QString vertexLabel (const long int &v1)
 Graph::vertexLabel Returns the label of a vertex v1. More...
 
void vertexLabelDistanceInit (const int &distance)
 Graph::vertexLabelDistanceInit Changes the default distance of vertex labels. More...
 
void vertexLabelDistanceSet (const long int &v, const int &newDistance)
 Graph::vertexLabelDistanceSet Changes the distance.of vertex v label from the vertex. More...
 
void vertexLabelDistanceAllSet (const int &newDistance)
 Graph::vertexLabelDistanceAllSet Changes the distance.of all vertex labels from their vertices. More...
 
void vertexPosSet (const int &v, const int &x, const int &y)
 Graph::vertexPosSet Called from MW/GW when node moves to update its position. More...
 
QPointF vertexPos (const int &v1)
 Graph::vertexPos. More...
 
int vertexClicked () const
 Graph::vertexClicked. More...
 
int vertices (const bool dropIsolates=false, const bool countAll=false)
 Graph::vertices Returns |V| of graph If countAll = true, returns |V| where V the set of all enabled or not vertices If countAll = false, it skips disabled vertices If countAll = false and dropIsolates = true, it skips both disabled and isolated vertices. More...
 
int vertexEdgesOutbound (int i)
 Graph::vertexEdgesOutbound *Returns the number of outbound edges (arcs) from vertex v1. More...
 
int vertexEdgesInbound (int i)
 Graph::vertexEdgesInbound Returns the number of inbound edges (arcs) to vertex v1. More...
 
int verticesWithOutboundEdges ()
 
int verticesWithInboundEdges ()
 
int verticesWithReciprocalEdges ()
 
QList< int > verticesListIsolated ()
 Returns a list of all isolated vertices inside the graph Used by Graph::graphMatrixAdjacencyCreate() Graph::writeMatrixAdjacencyInvert() Graph::centralityInformation() Graph::graphConnectedness() More...
 
QList< int > verticesList ()
 Returns a list of all vertices numbers inside the graph. More...
 
QSet< int > verticesSet ()
 Returns a QSet of all vertices numbers inside the graph. More...
 
void verticesCreateSubgraph (QList< int > vList, const int &type=SUBGRAPH_CLIQUE, const int &center=0)
 Creates a subgraph (clique, star, cycle, line) with vertices in vList Iff vList is empty, then fallbacks to the m_selectedVertices. More...
 
qreal graphDistanceEuclidean (const QPointF &a, const QPointF &b)
 Computes the euclideian distance between QPointF a and b. More...
 
qreal graphDistanceEuclidean (const QPointF &a)
 the euclideian distance of QPointF a (where a is difference vector) More...
 
int sign (const qreal &D)
 Graph::sign returns the sign of number D as integer (1 or -1) More...
 
qreal layoutForceDirected_F_rep (const QString model, const qreal &dist, const qreal &optimalDistance)
 
qreal layoutForceDirected_F_att (const QString model, const qreal &dist, const qreal &optimalDistance)
 
void layoutForceDirected_Eades_moveNodes (const qreal &c4)
 
void layoutForceDirected_FR_moveNodes (const qreal &temperature)
 Graph::layoutForceDirected_FR_moveNodes. More...
 
qreal layoutForceDirected_FR_temperature (const int iteration) const
 Graph::layoutForceDirected_FR_temperature Reduces the temperature as the layout approaches a better configuration. More...
 
qreal computeOptimalDistance (const int &Vertices)
 Graph::computeOptimalDistance. More...
 
void compute_angles (const QPointF &Delta, const qreal &dist, qreal &angle1, qreal &angle2, qreal &degrees1, qreal &degrees2)
 Graph::compute_angles Computes the two angles of the orthogonal triangle shaped by two points of difference vector DV and distance dist A = 90 B = angle1 C = angle2. More...
 
int edgesEnabled ()
 Graph::edgesEnabled Returns |E| of graph - only the enabled edges. More...
 
ClickedEdge edgeClicked ()
 
float edgeExists (const long &v1, const long &v2, const bool &undirected=false)
 Graph::edgeExists Checks if there is a (un)directed edge (arc) from v1 to v2 Complexity: O(logN) for index retrieval + O(1) for QList index retrieval + O(logN) for checking edge(v2) More...
 
void edgeRemove (const long int &v1, const long int &v2, const bool &removeOpposite=false)
 Graph::edgeRemove Removes the edge (arc) between v1 and v2. More...
 
bool edgeSymmetric (const long &v1, const long &v2)
 Graph::edgeSymmetric Returns TRUE if (v1, v2) is symmetric. More...
 
void edgeUndirectedSet (const long int &v1, const long int &v2, const float &w)
 Graph::edgeUndirectedSet Tranforms an edge to undirected Emits setEdgeUndirected to GW. More...
 
void edgeWeightSet (const long int &v1, const long int &v2, const float &w, const bool &undirected=false)
 Graph::edgeWeightSet Changes the weight of an edge (arc) between v1 and v2. More...
 
float edgeWeight (const long int &v1, const long int &v2) const
 Graph::edgeWeight Returns the color qstring of the directed edge v1 -> v2. More...
 
void edgeWeightNumbersVisibilitySet (const bool &toggle)
 Graph::edgeWeightNumbersVisibilitySet Changes the visibility of edge weight numbers. More...
 
void edgeLabelSet (const long int &v1, const long int &v2, const QString &label)
 Graph::edgeLabelSet Changes the label of edge v1 -> v2. More...
 
QString edgeLabel (const long int &v1, const long int &v2) const
 Graph::edgeLabel Returns the label of edge v1->v2. More...
 
void edgeLabelsVisibilitySet (const bool &toggle)
 Graph::edgeLabelsVisibilitySet. More...
 
void edgeColorInit (const QString &)
 Graph::edgeColorInit Saves the default edge color Used by random network creation methods. More...
 
void edgeColorSet (const long int &v1, const long int &v2, const QString &color)
 Graph::edgeColorSet Changes the color of edge s -> t. More...
 
QString edgeColor (const long int &v1, const long int &v2)
 Graph::edgeColor Returns the color qstring of the directed edge v1 -> v2. More...
 
bool edgeColorAllSet (const QString &color, const int &threshold=RAND_MAX)
 Graph::edgeColorAllSet Changes the color of all edges. More...
 
void graphModifiedSet (const int &graphNewStatus, const bool &signalMW=true)
 Graph::graphModifiedSet. More...
 
bool graphModified () const
 Graph::graphModified Returns true of graph is modified (edges/vertices added/removed). else false. More...
 
bool graphSaved () const
 Graph::graphSaved. More...
 
bool graphLoaded () const
 Graph::graphLoaded. More...
 
void graphSelectionChanged (const QList< int > &selectedVertices, const QList< SelectedEdge > &selectedEdges)
 Gets updates on the user-selected vertices and edges from GW and emits their counts to MW. More...
 
QList< int > graphSelectedVertices () const
 Returns a QList of user-selected vertices. More...
 
int graphSelectedVerticesCount () const
 Returns count of user-selected vertices. More...
 
int graphSelectedVerticesMin () const
 Returns min of user-selected vertices. More...
 
int graphSelectedVerticesMax () const
 Returns max of user-selected vertices. More...
 
QList< SelectedEdgegraphSelectedEdges () const
 Returns a QList of user-selected edges in pair<int,int> More...
 
int graphSelectedEdgesCount () const
 Returns count of user-selected edges. More...
 
int graphGeodesics ()
 Graph::graphGeodesics Returns the number of geodesics (shortest-paths) in the graph. More...
 
float graphDensity ()
 Graph::graphDensity Returns ratio of present edges to total possible edges. More...
 
bool graphWeighted ()
 Graph::graphWeighted Checks if the graph is weighted (valued), i.e. if any e in |E| has value not 0 or 1 Complexity: O(n^2) More...
 
bool graphSymmetric ()
 Graph::graphSymmetric Returns TRUE if the adjacency matrix of the current relation is symmetric. More...
 
void graphSymmetrize ()
 Graph::graphSymmetrize Transforms the graph to symmetric (all edges reciprocal) More...
 
void graphSymmetrizeStrongTies (const bool &allRelations=false)
 Graph::graphSymmetrizeStrongTies. More...
 
void graphCocitation ()
 Creates a new symmetric relation by connecting those actors that are cocitated by others. In the new relation, an edge will exist between actor i and actor j only if C(i,j) > 0, where C the Cocitation Matrix. Thus the actor pairs cited by more common neighbors will appear with a stronger tie between them than pairs those cited by fewer common neighbors. The resulting relation is symmetric. More...
 
void graphUndirectedSet (const bool &toggle, const bool &signalMW=true)
 Graph::undirected Transforms the graph to undirected. More...
 
bool graphUndirected ()
 
void graphMatrixAdjacencyCreate (const bool dropIsolates=false, const bool considerWeights=true, const bool inverseWeights=false, const bool symmetrize=false)
 
bool graphMatrixAdjacencyInvert (const QString &method="lu")
 
void graphMatrixSimilarityMatchingCreate (Matrix &AM, Matrix &SEM, const int &measure=METRIC_SIMPLE_MATCHING, const QString &varLocation="Rows", const bool &diagonal=false, const bool &considerWeights=true)
 Calls Matrix:similarityMatrix to compute the similarity matrix SCM of the variables (rows, columns, both) in given input matrix using the selected matching measure. More...
 
void graphMatrixSimilarityPearsonCreate (Matrix &AM, Matrix &PCC, const QString &varLocation="Rows", const bool &diagonal=false)
 The Pearson product-moment correlation coefficient (PPMCC, PCC or Pearson's r) is a measure of the linear dependence between two variables X and Y. More...
 
void graphMatrixDissimilaritiesCreate (Matrix &INPUT_MATRIX, Matrix &DSM, const int &metric, const QString &varLocation, const bool &diagonal, const bool &considerWeights)
 Calls Matrix:distancesMatrix to compute the dissimilarities matrix DSM of the variables (rows, columns, both) in given input matrix using the user defined metric. More...
 
void writeDataSetToFile (const QString dir, const QString)
 Graph::writeDataSetToFile Writes a known dataset to the given file. More...
 
void writeMatrixAdjacencyTo (QTextStream &os, const bool &saveEdgeWeights=true)
 
void writeMatrix (const QString &fileName, const int &matrix=MATRIX_ADJACENCY, const bool &considerWeights=true, const bool &inverseWeights=false, const bool &dropIsolates=false, const QString &varLocation="Rows", const bool &simpler=false)
 
void writeMatrixAdjacency (const QString fileName, const bool &markDiag=true)
 
void writeMatrixAdjacencyPlot (const QString fileName, const bool &simpler=false)
 
void writeMatrixAdjacencyInvert (const QString &filename, const QString &method)
 
void writeMatrixLaplacianPlainText (const QString &filename)
 Computes the Laplacian matrix of the graph and writes it to given file. More...
 
void writeMatrixDegreeText (const QString &filename)
 Computes the Degree matrix of the graph and writes it to given file. More...
 
void writeMatrixDistancesPlainText (const QString &fn, const bool &considerWeights, const bool &inverseWeights, const bool &dropIsolates)
 Graph::writeMatrixDistancesPlainText Writes the matrix of distances to a file. More...
 
void writeMatrixNumberOfGeodesicsPlainText (const QString &fn, const bool &considerWeights, const bool &inverseWeights)
 
void writeMatrixDissimilarities (const QString fileName, const QString &metricStr, const QString &varLocation, const bool &diagonal, const bool &considerWeights)
 Writes dissimilarity matrix based on a metric/measure to given html file. More...
 
void writeMatrixSimilarityMatchingPlain (const QString fileName, const int &measure=METRIC_SIMPLE_MATCHING, const QString &matrix="adjacency", const QString &varLocation="rows", const bool &diagonal=false, const bool &considerWeights=true)
 Writes similarity matrix based on a matching measure to given file. More...
 
void writeMatrixSimilarityMatching (const QString fileName, const QString &measure="Simple", const QString &matrix="adjacency", const QString &varLocation="rows", const bool &diagonal=false, const bool &considerWeights=true)
 Writes similarity matrix based on a matching measure to given html file. More...
 
void writeMatrixSimilarityPearson (const QString fileName, const bool considerWeights, const QString &matrix="adjacency", const QString &varLocation="rows", const bool &diagonal=false)
 Calls Graph::graphMatrixSimilarityPearsonCreate() and writes Pearson Correlation Coefficients to given file. More...
 
void writeMatrixSimilarityPearsonPlainText (const QString fileName, const bool considerWeights, const QString &matrix="adjacency", const QString &varLocation="rows", const bool &diagonal=false)
 Calls Graph::graphSimilariyPearsonCorrelationCoefficients() and writes Pearson Correlation Coefficients to given file. More...
 
void writeEccentricity (const QString, const bool considerWeights, const bool inverseWeights, const bool dropIsolates)
 Graph::writeEccentricity. More...
 
void writeCentralityDegree (const QString, const bool weights, const bool dropIsolates)
 Graph::writeCentralityDegree. More...
 
void writeCentralityCloseness (const QString, const bool weights, const bool inverseWeights, const bool dropIsolates)
 Writes the closeness centralities to a file. More...
 
void writeCentralityClosenessInfluenceRange (const QString, const bool weights, const bool inverseWeights, const bool dropIsolates)
 
void writeCentralityBetweenness (const QString, const bool weights, const bool inverseWeights, const bool dropIsolates)
 Writes Betweeness centralities to file. More...
 
void writeCentralityPower (const QString, const bool weigths, const bool inverseWeights, const bool dropIsolates)
 Graph::writeCentralityPower. More...
 
void writeCentralityStress (const QString, const bool weigths, const bool inverseWeights, const bool dropIsolates)
 
void writeCentralityEccentricity (const QString, const bool weigths, const bool inverseWeights, const bool dropIsolates)
 Graph::writeCentralityEccentricity. More...
 
void writeCentralityInformation (const QString, const bool weigths, const bool inverseWeights)
 
void writeCentralityEigenvector (const QString, const bool &weigths=true, const bool &inverseWeights=false, const bool &dropIsolates=false)
 
void writePrestigeDegree (const QString, const bool weights, const bool dropIsolates)
 Graph::writePrestigeDegree. More...
 
void writePrestigeProximity (const QString, const bool weights, const bool inverseWeights, const bool dropIsolates)
 Graph::writePrestigeProximity Writes the proximity prestige indices to a file. More...
 
void writePrestigePageRank (const QString, const bool Isolates=false)
 Graph::writePrestigePageRank Writes the PageRank indices to a file. More...
 
void writeClusteringHierarchical (const QString &fileName, const QString &matrix="Adjancency", const QString &metric="Manhattan", const QString &method="Complete", const bool &diagonal=false, const bool &dendrogram=false, const bool &considerWeights=true, const bool &inverseWeights=false, const bool &dropIsolates=false)
 Writes Hierarchical Clustering Analysis to a given file. More...
 
void writeClusteringHierarchicalResultsToStream (QTextStream &outText, const int N, const bool &dendrogram=false)
 
void writeCliqueCensus (const QString fileName, const bool considerWeights)
 Graph::writeCliqueCensus Writes the number of cliques (maximal connected subgraphs) of each vertex into a given file. More...
 
void writeClusteringCoefficient (const QString, const bool)
 Graph::writeClusteringCoefficient Writes the clustering coefficients to a file. More...
 
void writeTriadCensus (const QString, const bool)
 
int graphDistanceGeodesic (const int, const int, const bool considerWeights, const bool inverseWeights)
 Graph::graphDistanceGeodesic Returns the graphDistanceGeodesic between nodes numbered (i-1) and (j-1) More...
 
int graphDiameter (const bool considerWeights, const bool inverseWeights)
 Returns the diameter of the graph, aka the largest geodesic distance between any two vertices. More...
 
float graphDistanceGeodesicAverage (const bool considerWeights, const bool inverseWeights, const bool dropIsolates)
 Graph::graphDistanceGeodesicAverage Returns the average distance of the graph. More...
 
int graphConnectedness (const bool updateProgress=false)
 Graph::graphConnectedness() More...
 
void graphMatrixDistancesCreate (const bool &computeCentralities=false, const bool &considerWeights=false, const bool &inverseWeights=true, const bool &dropIsolates=false)
 Computes the distance matrix, DM, with geodesic distances between all vertices: DM(i,j)=geodesic distance between vertex i and vertex j In the process, it also computes many other matrices and metrics: More...
 
void centralityDegree (const bool &weights=true, const bool &dropIsolates=false)
 
void centralityInformation (const bool considerWeights=false, const bool inverseWeights=false)
 Graph::centralityInformation Calculates the Information centrality of each vertex - diagonal included Note that there is no known generalization of Stephenson&Zelen's theory for information centrality to directional data. More...
 
void centralityEigenvector (const bool &considerWeights=false, const bool &inverseWeights=false, const bool &dropIsolates=false)
 Computes Eigenvector centrality. More...
 
void centralityClosenessIR (const bool considerWeights=false, const bool inverseWeights=false, const bool dropIsolates=false)
 Graph::centralityClosenessIR Improved node-level centrality closeness index which focuses on the influence range of each node (the set of nodes that are reachable from it) For each node v, this index calculates the fraction of nodes in its influence range and divides it by the average distance of those nodes from v, ignoring nodes that are not reachable from it. More...
 
void prestigeDegree (const bool &weights, const bool &dropIsolates=false)
 Graph::prestigeDegree Calculates Degree Prestige (in-degree) of each vertex - diagonal included Also the mean value and the variance of the in-degrees. More...
 
void prestigePageRank (const bool &dropIsolates=false)
 Graph::prestigePageRank Calculates the PageRank Prestige of each vertex. More...
 
void prestigeProximity (const bool considerWeights=false, const bool inverseWeights=false, const bool dropIsolates=false)
 Graph::prestigeProximity Calculates Proximity Prestige of each vertex Also the mean value and the variance of it.. More...
 
int walksBetween (int v1, int v2, int length)
 Graph::walksBetween Calculates and returns the number of walks of a given length between v1 and v2. More...
 
void graphWalksMatrixCreate (const int &vertices=0, const int &length=0, const bool &updateProgress=false)
 Computes either the "Walks of given length" or the "Total Walks" matrix. If length>0, it computes the Walks of given length matrix, XM=AM^l where each element (i,j) denotes the number of walks of length l between vertex i and j. If length=0, it computes the Total Walks matrix, XSM=Sum{AM^n} where each (i,j) denotes the total number of walks of any length between vertices i and j. NOTE: In the latter case, this function is VERY SLOW on large networks (n>50), since it will calculate all powers of the sociomatrix up to n-1 in order to find out all possible walks. More...
 
void writeWalksTotalMatrixPlainText (const QString &fn)
 Graph::writeWalksTotalMatrixPlainText Writes the total number of walks matrix. More...
 
void writeWalksOfLengthMatrixPlainText (const QString &fn, const int &length)
 Graph::writeWalksOfLengthMatrixPlainText. More...
 
void writeMatrixWalks (const QString &fn, const int &length=0, const bool &simpler=false)
 Calls graphWalksMatrixCreate() to compute walks and writes the Walks of given length matrix to a file in HTML. If length = 0, it writes the Total Walks matrix. More...
 
int reachable (const int &v1, const int &v2)
 
QList< int > vertexinfluenceRange (int v1)
 
QList< int > vertexinfluenceDomain (int v2)
 Graph::vertexinfluenceDomain Returns the influence domain of vertex v1, namely the set of nodes who can reach v1 This function applies to digraphs only. More...
 
void writeReachabilityMatrixPlainText (const QString &fn, const bool &dropIsolates=false)
 
float numberOfTriples (int v1)
 
void graphCliques (QSet< int > R=QSet< int >(), QSet< int > P=QSet< int >(), QSet< int > X=QSet< int >())
 Finds all maximal cliques in an undirected (?) graph. Implements the Bron–Kerbosch algorithm, a recursive backtracking algorithm that searches for all maximal cliques in a given graph G. Given three sets R, P, and X, the algorithm finds the maximal cliques that include all of the vertices in R, some of the vertices in P, and none of the vertices in X. In each call to the algorithm, P and X are disjoint sets whose union consists of those vertices that form cliques when added to R. In other words, P ∪ X is the set of vertices which are joined to every element of R. When P and X are both empty there are no further elements that can be added to R, so R is a maximal clique and the algorithm outputs R. The recursion is initiated by setting R and X to be the empty set and P to be the vertex set of the graph. Within each recursive call, the algorithm considers the vertices in P in turn. if there are no vertices, it either reports R as a maximal clique (if X is empty), or backtracks. For each vertex v chosen from P, it makes a recursive call in which v is added to R and in which P and X are restricted to the neighbor set N(v) of v, which finds and reports all clique extensions of R that contain v. Then, it moves v from P to X to exclude it from consideration in future cliques and continues with the next vertex in P. More...
 
void graphCliqueAdd (const QList< int > &clique)
 Called from Graph::graphCliques to add a new clique (list of vertices) Adds clique info to each clique member and updates CLQM matrix. More...
 
int graphCliquesContaining (const int &actor, const int &size=0)
 
int graphCliquesOfSize (const int &size)
 Graph::graphCliquesOfSize Returns the number of maximal cliques of a given size. More...
 
void graphClusteringHierarchical (Matrix &STR_EQUIV, const int &metric, const int &method, const bool &diagonal=false, const bool &diagram=false, const bool &considerWeights=true, const bool &inverseWeights=false, const bool &dropIsolates=false)
 Performs an hierarchical clustering process (Johnson, 1967) on a given NxN distance/dissimilarity matrix. The input matrix can be the the adjacency matrix, the geodesic distance matrix or a derived from them dissimilarities matrix using a user-specified metric, i.e. euclidean distance. The method parameter defines how to compute distances (similarities) between a new cluster the old clusters. Valid values can be: More...
 
float clusteringCoefficientLocal (const long int &v1)
 Graph::clusteringCoefficientLocal Returns the local clustering coefficient (CLUCOF) of a vertex v1 CLUCOF in a graph quantifies how close the vertex and its neighbors are to being a clique, a connected subgraph. This is used to determine whether a graph is a small-world network. More...
 
float clusteringCoefficient (const bool updateProgress=false)
 Graph::clusteringCoefficient Calculates local clustering coefficients and returns the network average Clustering Coefficient. More...
 
bool graphTriadCensus ()
 Graph::graphTriadCensus Conducts a triad census and updates QList::triadTypeFreqs, which is the list carrying all triad type frequencies Complexity:O(n!) More...
 
void triadType_examine_MAN_label (int, int, int, Vertex *, Vertex *, Vertex *)
 
void layoutRandom ()
 Graph::layoutRandom Repositions all nodes on different random positions Emits setNodePos(i, x,y) to tell GW that the node item should be moved. More...
 
void layoutCircularRandom (double x0, double y0, double maxRadius)
 Graph::layoutCircularRandom Repositions all nodes on the periphery of different circles with random radius. More...
 
void layoutCircularByProminenceIndex (double x0, double y0, double maxRadius, int type, const bool considerWeights, const bool inverseWeights, const bool dropIsolates)
 Graph::layoutCircularByProminenceIndex Repositions all nodes on the periphery of different circles with radius analogous to their prominence index. More...
 
void layoutLevelByProminenceIndex (double maxWidth, double maxHeight, int type, const bool considerWeights, const bool inverseWeights, const bool dropIsolates)
 Graph::layoutLevelByProminenceIndex Repositions all nodes on different top-down levels according to their centrality Emits setNodePos(i, x,y) to tell GW that the node item should be moved. More...
 
void layoutVerticesSizeByProminenceIndex (int index, const bool considerWeights, const bool inverseWeights, const bool dropIsolates)
 Graph::layoutVerticesSizeByProminenceIndex changes the node size to be proportinal to given prominence index. More...
 
void layoutForceDirectedSpringEmbedder (const int maxIterations)
 Graph::layoutForceDirectedSpringEmbedder. More...
 
void layoutForceDirectedFruchtermanReingold (const int maxIterations)
 Graph::layoutForceDirectedFruchtermanReingold. More...
 
void layoutForceDirectedKamadaKawai (const int maxIterations)
 Graph::layoutForceDirectedKamadaKawai In this model, the graph is considered to be a dynamic system where every two vertices are connected by a 'spring'. Each spring has a desirable length, which corresponds to their graph theoretic distance. In this way, the optimal layout of the graph is the state with the minimum imbalance. The degree of imbalance is formulated as the total spring energy: the square summation of the differences between desirable distances and real ones for all pairs of vertices. More...
 
void webCrawlTerminateThreads (QString reason)
 
void randomizeThings ()
 Graph::randomizeThings Adds a little universal randomness :) More...
 
void randomNetErdosCreate (const int &vert, const QString &model, const int &edges, const float &eprob, const QString &mode, const bool &diag)
 Graph::randomNetErdosCreate. More...
 
void randomNetRingLatticeCreate (const int &vert, const int &degree, const bool updateProgress=false)
 Graph::randomNetRingLatticeCreate Creates a random ring lattice network. More...
 
void randomNetRegularCreate (const int &vert, const int &degree, const QString &mode, const bool &diag)
 Graph::randomNetRegularCreate Creates a random network where nodes have the same degree. More...
 
void randomNetScaleFreeCreate (const int &n, const int &power, const int &m0, const int &m, const float &alpha, const QString &mode)
 
void randomNetSmallWorldCreate (const int &vert, const int &degree, const double &beta, const QString &mode)
 Graph::randomNetSmallWorldCreate Creates a small world network. More...
 
int factorial (int)
 

Public Attributes

H_Int index
 
H_Int sizeOfNthOrderNeighborhood
 

Protected Member Functions

void timerEvent (QTimerEvent *event)
 

Private Member Functions

void vertexAdd (const int &v1, const int &val, const int &size, const QString &color, const QString &numColor, const int &numSize, const QString &label, const QString &labelColor, const int &labelSize, const QPointF &p, const QString &shape)
 Adds a Vertex named v1, valued val, sized nszm colored nc, labeled nl, labelColored lc, shaped nsp, at point p. This method is called by vertexCreate() method. More...
 
void edgeAdd (const int &v1, const int &v2, const float &weight, const int &type, const QString &label, const QString &color)
 Graph::edgeAdd Adds an edge between v1 and v2. More...
 
void BFS (const int &s, const bool &computeCentralities=false, const bool &dropIsolates=false)
 
void dijkstra (const int &s, const bool &computeCentralities=false, const bool &inverseWeights=false, const bool &dropIsolates=false)
 
void minmax (float C, Vertex *v, float &max, float &min, int &maxNode, int &minNode)
 
void resolveClasses (float C, H_StrToInt &discreteClasses, int &classes)
 
void resolveClasses (float C, H_StrToInt &discreteClasses, int &classes, int name)
 

Private Attributes

QThread file_parserThread
 
QThread wc_parserThread
 
QThread wc_spiderThread
 
Vertices m_graph
 
Parserfile_parser
 
WebCrawler_Parserwc_parser
 
WebCrawler_Spiderwc_spider
 
QList< QString > m_relationsList
 
QList< int > triadTypeFreqs
 
QList< int > m_isolatedVerticesList
 
QList< int > m_verticesList
 
QList< int > m_graphFileFormatExportSupported
 
QSet< int > m_verticesSet
 
QList< SelectedEdgem_selectedEdges
 
QList< int > m_selectedVertices
 
QHash< int, int > influenceRanges
 
QHash< int, int > influenceDomains
 
QHash< int, int > m_vertexPairsNotConnected
 
QHash< int, int > m_vertexPairsUnilaterallyConnected
 
QMap< int, L_intm_cliques
 
QList< float > m_clusteringLevel
 
QMap< int, V_intm_clustersPerSequence
 
QMap< QString, V_intm_clustersByName
 
QMap< int, V_strm_clusterPairNamesPerSeq
 
Matrix TM
 
Matrix DM
 
Matrix sumM
 
Matrix invAM
 
Matrix AM
 
Matrix invM
 
Matrix XM
 
Matrix XSM
 
Matrix XRM
 
Matrix CLQM
 
stack< int > Stack
 
H_StrToInt discreteDPs
 
H_StrToInt discreteSDCs
 
H_StrToInt discreteCCs
 
H_StrToInt discreteBCs
 
H_StrToInt discreteSCs
 
H_StrToInt discreteIRCCs
 
H_StrToInt discreteECs
 
H_StrToInt discreteEccentricities
 
H_StrToInt discretePCs
 
H_StrToInt discreteICs
 
H_StrToInt discretePRPs
 
H_StrToInt discretePPs
 
H_StrToInt discreteEVCs
 
int m_precision
 
int m_fieldWidth
 
int m_curRelation
 
int m_fileFormat
 
int m_vertexClicked
 
ClickedEdge m_clickedEdge
 
float edgeWeightTemp
 
float edgeReverseWeightTemp
 
float meanSDC
 
float varianceSDC
 
float meanSCC
 
float varianceSCC
 
float meanIRCC
 
float varianceIRCC
 
float meanSBC
 
float varianceSBC
 
float meanSSC
 
float varianceSSC
 
float meanEC
 
float varianceEC
 
float meanSPC
 
float varianceSPC
 
float meanIC
 
float varianceIC
 
float meanEVC
 
float varianceEVC
 
float meanSDP
 
float varianceSDP
 
float meanPP
 
float variancePP
 
float meanPRP
 
float variancePRP
 
float minEccentricity
 
float maxEccentricity
 
float sumEccentricity
 
float minSDP
 
float maxSDP
 
float sumDP
 
float sumSDP
 
float groupDP
 
float minSDC
 
float maxSDC
 
float sumDC
 
float sumSDC
 
float groupDC
 
float minSCC
 
float maxSCC
 
float nomSCC
 
float denomSCC
 
float sumCC
 
float sumSCC
 
float groupCC
 
float maxIndexCC
 
float minIRCC
 
float maxIRCC
 
float nomIRCC
 
float denomIRCC
 
float sumIRCC
 
float groupIRCC
 
float minSBC
 
float maxSBC
 
float nomSBC
 
float denomSBC
 
float sumBC
 
float sumSBC
 
float groupSBC
 
float maxIndexBC
 
float minSPC
 
float maxSPC
 
float nomSPC
 
float denomSPC
 
float t_sumIC
 
float sumSPC
 
float groupSPC
 
float maxIndexPC
 
float minSSC
 
float maxSSC
 
float sumSC
 
float sumSSC
 
float groupSC
 
float maxIndexSC
 
float minEC
 
float maxEC
 
float nomEC
 
float denomEC
 
float sumEC
 
float groupEC
 
float maxIndexEC
 
float minIC
 
float maxIC
 
float nomIC
 
float denomIC
 
float sumIC
 
float maxIndexIC
 
float minEVC
 
float maxEVC
 
float nomEVC
 
float denomEVC
 
float sumEVC
 
float sumSEVC
 
float groupEVC
 
float minPRP
 
float maxPRP
 
float nomPRC
 
float denomPRC
 
float sumPC
 
float t_sumPRP
 
float sumPRP
 
float minPP
 
float maxPP
 
float nomPP
 
float denomPP
 
float sumPP
 
float groupPP
 
float minCLC
 
float maxCLC
 
float averageCLC
 
float varianceCLC
 
float d_factor
 
int maxNodeCLC
 
int minNodeCLC
 
int classesSDP
 
int maxNodeDP
 
int minNodeDP
 
int classesSDC
 
int maxNodeSDC
 
int minNodeSDC
 
int classesSCC
 
int maxNodeSCC
 
int minNodeSCC
 
int classesIRCC
 
int maxNodeIRCC
 
int minNodeIRCC
 
int classesSBC
 
int maxNodeSBC
 
int minNodeSBC
 
int classesSPC
 
int maxNodeSPC
 
int minNodeSPC
 
int classesSSC
 
int maxNodeSSC
 
int minNodeSSC
 
int classesEC
 
int maxNodeEC
 
int minNodeEC
 
int classesEccentricity
 
int maxNodeEccentricity
 
int minNodeEccentricity
 
int classesIC
 
int maxNodeIC
 
int minNodeIC
 
int classesPRP
 
int maxNodePRP
 
int minNodePRP
 
int classesPP
 
int maxNodePP
 
int minNodePP
 
int classesEVC
 
int maxNodeEVC
 
int minNodeEVC
 
int sizeOfComponent
 
int graphModifiedFlag
 
long int m_totalVertices
 
long int m_totalEdges
 
long int m_graphDiameter
 
long int initVertexSize
 
int initVertexLabelSize
 
int initVertexNumberSize
 
int initVertexNumberDistance
 
int initVertexLabelDistance
 
bool order
 
bool initVertexLabelsVisibility
 
bool initVertexNumbersVisibility
 
bool initVertexNumberInside
 
bool initEdgeWeightNumbers
 
bool initEdgeLabels
 
float m_graphAverageDistance
 
float m_graphGeodesicsCount
 
float m_graphDensity
 
int m_graphConnectedness
 
int outboundEdgesVert
 
int inboundEdgesVert
 
int reciprocalEdgesVert
 
int timerId
 
int canvasWidth
 
int canvasHeight
 
bool calculatedEdges
 
bool calculatedVertices
 
bool calculatedVerticesList
 
bool calculatedVerticesSet
 
bool calculatedAdjacencyMatrix
 
bool calculatedDistances
 
bool calculatedCentralities
 
bool calculatedIsolates
 
bool calculatedEVC
 
bool calculatedDP
 
bool calculatedDC
 
bool calculatedPP
 
bool calculatedIRCC
 
bool calculatedIC
 
bool calculatedPRP
 
bool calculatedTriad
 
bool calculatedGraphSymmetry
 
bool calculatedGraphDensity
 
bool calculatedGraphWeighted
 
bool m_undirected
 
bool m_symmetric
 
bool m_isWeighted
 
QString VERSION
 
QString fileName
 
QString m_graphName
 
QString initEdgeColor
 
QString initVertexColor
 
QString initVertexNumberColor
 
QString initVertexLabelColor
 
QString initVertexShape
 
QString htmlHead
 
QString htmlHeadLight
 
QString htmlEnd
 
QDateTime actualDateTime
 

Detailed Description

The Graph class This is the main class for a Graph, used in conjuction with Vertex, Parser and Matrix objects. Graph class methods are the interface to various analysis algorithms Vertex class holds each vertex data (colors, strings, statistics, etc) Matrix class holds the adjacency matrix of the network. Parser class loads files of networks.

TODO & KNOWN BUGS:

Todo:

Group edge editing: i.e. change weight or color.

Enrich Node properties dialog

Update app icons

- CHECK weighted networks results (IRCC and distance matrix with other combinations)

- CHECK graphWeighted corner case results, when !graphModified.

- CHECK graphConnectedness() algorithm implementation (m_vertexPairsUnilaterallyConnected)

Bug:

Create d-regular, undirected, ask for closeness, it says we are on a disconnected graph

Crash on Graphml files with textlabels instead of nodenumbers (i.e. nets/killer.graphml)

wontfix Crash on Graphml files with html special chars in node/edge labels

Pajek files with no ic / label in nodes are displayed without colors???

wrong default edge colors (not the ones used by Settings) after loading GraphML files.

Resizing the MW view does not resize/reposition the layout guides

Fruchterman-Reingold model fixes some nodes to (1,1) breaking the layout

TODO Change Menus to: Matrices Cohesion/Connectedness: Density, Reachability, and All distance and Walks, Connectivity, Reciprocity, Transitivity ?, Clu Cof Prominence: Centrality and Prestige Subgroups / Communities: Cliques (later clans etc), (later path distance MDS) Components, Blocks and Cutpoints, Structural Equivalence: HCA, Similarity (later MDS), Block modelling, CONCOR

Constructor & Destructor Documentation

Graph::Graph ( )

Graph::Graph constructor.

Graph::~Graph ( )

Member Function Documentation

void Graph::addGuideCircle ( const double &  ,
const double &  ,
const double &   
)
signal
void Graph::addGuideHLine ( const double &  y0)
signal
void Graph::BFS ( const int &  s,
const bool &  computeCentralities = false,
const bool &  dropIsolates = false 
)
private

methods used by graphMatrixDistancesCreate()

Breadth-First Search (BFS) method for unweighted graphs (directed or not)

INPUT: a 'source' vertex with index s and a boolean computeCentralities. (Implicitly, BFS uses the m_graph structure)

OUTPUT: For every vertex t: DM(s, t) is set to the distance of each t from s For every vertex t: TM(s, t) is set to the number of shortest paths between s and t

Also, if computeCentralities is true then BFS does extra operations: a) For source vertex s: it calculates CC(s) as the sum of its distances from every other vertex. it calculates eccentricity(s) as the maximum distance from all other vertices. it increases sizeOfNthOrderNeighborhood [ N ] by one, to store the number of nodes at distance n from source s b) For every vertex u: it increases SC(u) by one, when it finds a new shor. path from s to t through u. appends each neighbor y of u to the list Ps, thus Ps stores all predecessors of y on all all shortest paths from s c) Each vertex u popped from Q is pushed to a stack Stack

double Graph::canvasMaxRadius ( ) const
slot
float Graph::canvasMinDimension ( ) const
slot
double Graph::canvasRandomX ( ) const
slot

Graph::canvasRandomX.

Returns
Returns a random x-coordinate adjusted to be visible inside the canvas usable area
double Graph::canvasRandomY ( ) const
slot

Graph::canvasRandomY.

Returns
Returns a random y-coordinate adjusted to be visible inside the canvas usable area
void Graph::canvasSizeSet ( const int  w,
const int  h 
)
slot

Graph::canvasSizeSet Called when MW and GraphicsWidget resizes to update canvasWidth and canvasHeight.

Parameters
w
h
double Graph::canvasVisibleX ( const double &  x) const
slot

Graph::canvasVisibleX.

Parameters
x
Returns
Checks if x is visible inside the canvas usable area and if not returns an adjusted x-coordinate
double Graph::canvasVisibleY ( const double &  y) const
slot

Graph::canvasVisibleY.

Parameters
y
Returns
Checks if y is visible inside the canvas usable area and if not returns an adjusted y-coordinate
void Graph::centralityClosenessIR ( const bool  considerWeights = false,
const bool  inverseWeights = false,
const bool  dropIsolates = false 
)

Graph::centralityClosenessIR Improved node-level centrality closeness index which focuses on the influence range of each node (the set of nodes that are reachable from it) For each node v, this index calculates the fraction of nodes in its influence range and divides it by the average distance of those nodes from v, ignoring nodes that are not reachable from it.

Parameters
considerWeights
inverseWeights
dropIsolates
void Graph::centralityDegree ( const bool &  weights = true,
const bool &  dropIsolates = false 
)
void Graph::centralityEigenvector ( const bool &  considerWeights = false,
const bool &  inverseWeights = false,
const bool &  dropIsolates = false 
)

Computes Eigenvector centrality.

Parameters
considerWeights
inverseWeights
void Graph::centralityInformation ( const bool  considerWeights = false,
const bool  inverseWeights = false 
)

Graph::centralityInformation Calculates the Information centrality of each vertex - diagonal included Note that there is no known generalization of Stephenson&Zelen's theory for information centrality to directional data.

Parameters
considerWeights
inverseWeights
void Graph::clear ( )

Clears all vertices

float Graph::clusteringCoefficient ( const bool  updateProgress = false)

Graph::clusteringCoefficient Calculates local clustering coefficients and returns the network average Clustering Coefficient.

Parameters
updateProgress
Returns
float Graph::clusteringCoefficientLocal ( const long int &  v1)

Graph::clusteringCoefficientLocal Returns the local clustering coefficient (CLUCOF) of a vertex v1 CLUCOF in a graph quantifies how close the vertex and its neighbors are to being a clique, a connected subgraph. This is used to determine whether a graph is a small-world network.

Parameters
v1
Returns
void Graph::compute_angles ( const QPointF &  DV,
const qreal &  dist,
qreal &  angle1,
qreal &  angle2,
qreal &  degrees1,
qreal &  degrees2 
)

Graph::compute_angles Computes the two angles of the orthogonal triangle shaped by two points of difference vector DV and distance dist A = 90 B = angle1 C = angle2.

Parameters
DV
dist
angle1
angle2
degrees1
degrees2
qreal Graph::computeOptimalDistance ( const int &  Vertices)

Graph::computeOptimalDistance.

Returns
qreal optimalDistance
void Graph::dijkstra ( const int &  s,
const bool &  computeCentralities = false,
const bool &  inverseWeights = false,
const bool &  dropIsolates = false 
)
private

Dijkstra's algorithm for the SSSP in weighted graphs (directed or not) It uses a min-priority queue prQ to provide constant time lookup of the minimum distance. The priority queue is implemented with std::priority_queue

INPUT: a 'source' vertex with index s and a boolean computeCentralities. (Implicitly, the algorithm uses the m_graph structure)

OUTPUT: For every vertex t: DM(s, t) is set to the distance of each t from s For every vertex t: TM(s, t) is set to the number of shortest paths between s and t

Also, if computeCentralities is true then it does extra operations: a) For source vertex s: it calculates CC(s) as the sum of its distances from every other vertex. it calculates eccentricity(s) as the maximum distance from all other vertices. it increases sizeOfNthOrderNeighborhood [ N ] by one, to store the number of nodes at distance n from source s b) For every vertex u: it increases SC(u) by one, when it finds a new shor. path from s to t through u. appends each neighbor y of u to the list Ps, thus Ps stores all predecessors of y on all all shortest paths from s c) Each vertex u popped from prQ is pushed to a stack Stack

void Graph::drawEdge ( const int &  v1,
const int &  v2,
const float &  weight,
const QString &  label = "",
const QString &  color = "black",
const int &  type = 0,
const bool  arrows = true,
const bool &  bezier = false,
const bool &  weightNumbers = false 
)
signal
void Graph::drawNode ( const int &  num,
const int &  size,
const QString &  nodeShape,
const QString &  nodeColor,
const bool &  showNumbers,
const bool &  numbersInside,
const QString &  numberColor,
const int &  numSize,
const int &  numDistance,
const bool &  showLabels,
const QString &  label,
const QString &  labelColor,
const int &  labelSize,
const int &  labelDistance,
const QPointF &  p 
)
signal

Signals to GraphicsWidget

void Graph::edgeAdd ( const int &  v1,
const int &  v2,
const float &  weight,
const int &  type,
const QString &  label,
const QString &  color 
)
private

Graph::edgeAdd Adds an edge between v1 and v2.

Parameters
v1
v2
weight
label
color
type
ClickedEdge Graph::edgeClicked ( )
void Graph::edgeClickedSet ( const int &  v1,
const int &  v2 
)
slot

Graph::vertexClickedSet.

Parameters
v1
QString Graph::edgeColor ( const long int &  v1,
const long int &  v2 
)

Graph::edgeColor Returns the color qstring of the directed edge v1 -> v2.

Parameters
v1
v2
Returns
bool Graph::edgeColorAllSet ( const QString &  color,
const int &  threshold = RAND_MAX 
)

Graph::edgeColorAllSet Changes the color of all edges.

Parameters
color
Returns
void Graph::edgeColorInit ( const QString &  color)

Graph::edgeColorInit Saves the default edge color Used by random network creation methods.

Parameters
color
void Graph::edgeColorSet ( const long int &  v1,
const long int &  v2,
const QString &  color 
)

Graph::edgeColorSet Changes the color of edge s -> t.

Parameters
v1
v2
color
void Graph::edgeCreate ( const int &  v1,
const int &  v2,
const float &  weight,
const QString &  color,
const int &  type = 0,
const bool &  drawArrows = true,
const bool &  bezier = false,
const QString &  label = QString::null,
const bool &  signalMW = true 
)
slot

Graph::edgeCreate Checks if edge exists, and if the opposite edge exists Calls edgeAdd to add the new edge to the Graph, then emits drawEdge() which calls GraphicsWidget::drawEdge() to draw the new edge. Called from homonymous signal of Parser class. Also called from MW when user clicks on the "add link" button Also called (via MW) from GW when user middle-clicks on two nodes.

Slots to signals from GraphicsWidget and Parser

Parameters
v1
v2
weight
color
reciprocal
drawArrows
bezier
void Graph::edgeCreateWebCrawler ( const int &  source,
const int &  target 
)
slot

Graph::edgeCreateWebCrawler Called from WebCrawler when it finds an new link Calls edgeCreate() method with initEdgeColor.

Parameters
source
target
float Graph::edgeExists ( const long &  v1,
const long &  v2,
const bool &  undirected = false 
)

Graph::edgeExists Checks if there is a (un)directed edge (arc) from v1 to v2 Complexity: O(logN) for index retrieval + O(1) for QList index retrieval + O(logN) for checking edge(v2)

Parameters
v1
v2
undirectedif true, check if there is an undirected edge v1<->v2
Returns
zero if arc does not exist or non-zero if arc exists
void Graph::edgeFilterByRelation ( int  relation,
bool  status 
)
slot

Graph::edgeFilterByRelation Filter out all edges of a given relation Calls the homonymous method of Vertex class.

Parameters
relation
void Graph::edgeFilterByWeight ( float  m_threshold,
bool  overThreshold 
)
slot

Graph::edgeFilterByWeight Called from MW::DialogEdgeFilter to filter edges over or under a specified weight (m_threshold). For each Vertex in the Graph, calls the homonymous method of Vertex class.

Parameters
m_threshold
overThreshold
void Graph::edgeFilterUnilateral ( const bool &  toggle)
slot

Graph::edgeFilterUnilateral Filters (enables/disables) unilateral edges in current relationship. If toggle=true, all non-reciprocal edges are disabled, effectively making the network symmetric.

Parameters
toggle
QString Graph::edgeLabel ( const long int &  v1,
const long int &  v2 
) const

Graph::edgeLabel Returns the label of edge v1->v2.

Parameters
v1
v2
Returns
void Graph::edgeLabelSet ( const long int &  v1,
const long int &  v2,
const QString &  label 
)

Graph::edgeLabelSet Changes the label of edge v1 -> v2.

Parameters
v1
v2
weight
void Graph::edgeLabelsVisibilitySet ( const bool &  toggle)

Graph::edgeLabelsVisibilitySet.

Parameters
toggle
void Graph::edgeRemove ( const long int &  v1,
const long int &  v2,
const bool &  removeOpposite = false 
)

Graph::edgeRemove Removes the edge (arc) between v1 and v2.

Parameters
v1
v2
undirectedif true it also removes the opposite edge
int Graph::edgesEnabled ( )

Graph::edgesEnabled Returns |E| of graph - only the enabled edges.

Returns
bool Graph::edgeSymmetric ( const long &  v1,
const long &  v2 
)

Graph::edgeSymmetric Returns TRUE if (v1, v2) is symmetric.

Parameters
v1
v2
Returns
void Graph::edgeUndirectedSet ( const long int &  v1,
const long int &  v2,
const float &  weight 
)

Graph::edgeUndirectedSet Tranforms an edge to undirected Emits setEdgeUndirected to GW.

Parameters
v1
v2
weight
void Graph::edgeVisibilitySet ( int  relation,
int  source,
int  target,
bool  visible 
)
slot

Graph::edgeVisibilitySet Changes the canvas visibility of an edge Called from Vertex when edgeFilterByWeight is called.

Parameters
relation
source
target
visible
float Graph::edgeWeight ( const long int &  v1,
const long int &  v2 
) const

Graph::edgeWeight Returns the color qstring of the directed edge v1 -> v2.

Parameters
v1
v2
Returns
void Graph::edgeWeightNumbersVisibilitySet ( const bool &  toggle)

Graph::edgeWeightNumbersVisibilitySet Changes the visibility of edge weight numbers.

Parameters
toggle
void Graph::edgeWeightSet ( const long int &  v1,
const long int &  v2,
const float &  w,
const bool &  undirected = false 
)

Graph::edgeWeightSet Changes the weight of an edge (arc) between v1 and v2.

Parameters
v1
v2
weight
void Graph::eraseEdge ( const long int &  ,
const long int &   
)
signal
void Graph::eraseNode ( long  int)
signal
int Graph::factorial ( int  x)

Calculates and returns x! factorial... used in (n 2)p edges calculation

void Graph::graphCliqueAdd ( const QList< int > &  clique)

Called from Graph::graphCliques to add a new clique (list of vertices) Adds clique info to each clique member and updates CLQM matrix.

Parameters
list
Returns
void Graph::graphCliques ( QSet< int >  R = QSet<int>(),
QSet< int >  P = QSet<int>(),
QSet< int >  X = QSet<int>() 
)

Finds all maximal cliques in an undirected (?) graph. Implements the Bron–Kerbosch algorithm, a recursive backtracking algorithm that searches for all maximal cliques in a given graph G. Given three sets R, P, and X, the algorithm finds the maximal cliques that include all of the vertices in R, some of the vertices in P, and none of the vertices in X. In each call to the algorithm, P and X are disjoint sets whose union consists of those vertices that form cliques when added to R. In other words, P ∪ X is the set of vertices which are joined to every element of R. When P and X are both empty there are no further elements that can be added to R, so R is a maximal clique and the algorithm outputs R. The recursion is initiated by setting R and X to be the empty set and P to be the vertex set of the graph. Within each recursive call, the algorithm considers the vertices in P in turn. if there are no vertices, it either reports R as a maximal clique (if X is empty), or backtracks. For each vertex v chosen from P, it makes a recursive call in which v is added to R and in which P and X are restricted to the neighbor set N(v) of v, which finds and reports all clique extensions of R that contain v. Then, it moves v from P to X to exclude it from consideration in future cliques and continues with the next vertex in P.

Parameters
R
P
X
int Graph::graphCliquesContaining ( const int &  actor,
const int &  size = 0 
)

Returns the number of maximal cliques which include a given actor

int Graph::graphCliquesOfSize ( const int &  size)

Graph::graphCliquesOfSize Returns the number of maximal cliques of a given size.

Parameters
size
Returns
void Graph::graphClusteringHierarchical ( Matrix STR_EQUIV,
const int &  metric,
const int &  method,
const bool &  diagonal = false,
const bool &  diagram = false,
const bool &  considerWeights = true,
const bool &  inverseWeights = false,
const bool &  dropIsolates = false 
)

Performs an hierarchical clustering process (Johnson, 1967) on a given NxN distance/dissimilarity matrix. The input matrix can be the the adjacency matrix, the geodesic distance matrix or a derived from them dissimilarities matrix using a user-specified metric, i.e. euclidean distance. The method parameter defines how to compute distances (similarities) between a new cluster the old clusters. Valid values can be:

  • CLUSTERING_SINGLE_LINKAGE: "single-link" or "connectedness" or "minimum"
  • CLUSTERING_COMPLETE_LINKAGE: "complete-link" or "diameter" or "maximum"
  • CLUSTERING_AVERAGE_LINKAGE: "average-link" or UPGMA
    Parameters
    matrix
    metric
    method
    considerWeights
    inverseWeights
    dropIsolates
int Graph::graphClusteringMethodStrToType ( const QString &  method) const

Helper method, return clustering method type from the human readable name of it.

Parameters
method
Returns
QString Graph::graphClusteringMethodTypeToString ( const int &  methodType) const

Helper method, return the human readable name of clustering method type.

Returns
void Graph::graphCocitation ( )

Creates a new symmetric relation by connecting those actors that are cocitated by others. In the new relation, an edge will exist between actor i and actor j only if C(i,j) > 0, where C the Cocitation Matrix. Thus the actor pairs cited by more common neighbors will appear with a stronger tie between them than pairs those cited by fewer common neighbors. The resulting relation is symmetric.

int Graph::graphConnectedness ( const bool  updateProgress = false)

Graph::graphConnectedness()

Returns
int:

2: strongly connected digraph (exists path from i to j and vice versa for every i,j) 1: connected undirected graph 0: not connected undirected graph no isolates -1: not connected undirected graph with isolates -2: unilaterally connected digraph (exists path only from i to j or from j to i, not both) -3 disconnected digraph (there are unconnected pairs, with isolates). -4 disconnected digraph (there are unconnected pairs, no isolates).

Used by MW::slotConnectedness() MW::slotAnalyzeCentralityCloseness() MW::slotLayoutCircularByProminenceIndex(QString ) MW::slotLayoutNodeSizesByProminenceIndex(QString ) MW::slotLayoutLevelByProminenceIndex(QString )

float Graph::graphDensity ( )

Graph::graphDensity Returns ratio of present edges to total possible edges.

Returns
int Graph::graphDiameter ( const bool  considerWeights,
const bool  inverseWeights 
)

Returns the diameter of the graph, aka the largest geodesic distance between any two vertices.

Parameters
considerWeights
inverseWeights
Returns
qreal Graph::graphDistanceEuclidean ( const QPointF &  a,
const QPointF &  b 
)

Computes the euclideian distance between QPointF a and b.

Parameters
a
b
Returns
qreal Graph::graphDistanceEuclidean ( const QPointF &  a)

the euclideian distance of QPointF a (where a is difference vector)

Parameters
a
Returns
int Graph::graphDistanceGeodesic ( const int  i,
const int  j,
const bool  considerWeights,
const bool  inverseWeights 
)

Graph::graphDistanceGeodesic Returns the graphDistanceGeodesic between nodes numbered (i-1) and (j-1)

Parameters
i
j
considerWeights
inverseWeights
Returns
float Graph::graphDistanceGeodesicAverage ( const bool  considerWeights,
const bool  inverseWeights,
const bool  dropIsolates 
)

Graph::graphDistanceGeodesicAverage Returns the average distance of the graph.

Parameters
considerWeights
inverseWeights
dropIsolates
Returns
int Graph::graphFileFormat ( ) const

graphFileFormat

Returns
Returns the format of the last file opened
bool Graph::graphFileFormatExportSupported ( const int &  fileFormat) const

Graph::graphFileFormatExportSupported.

Parameters
fileFormat
Returns
void Graph::graphFileLoaded ( const int &  fileType,
const QString &  fName = QString::null,
const QString &  netName = QString::null,
const int &  totalNodes = 0,
const int &  totalLinks = 0,
const bool &  undirected = false,
const QString &  message = QString::null 
)
slot

Graph::graphFileLoaded Updates MW with the loaded file type (0=nofile, 1=Pajek, 2=Adjacency etc) Called from Parser on file parsing end or file error.

Parameters
type
netName
aNodes
totalLinks
undirected
int Graph::graphGeodesics ( )

Graph::graphGeodesics Returns the number of geodesics (shortest-paths) in the graph.

Returns
void Graph::graphLoad ( const QString  m_fileName,
const QString  m_codecName,
const bool  m_showLabels,
const int  fileFormat,
const int  two_sm_mode,
const QString  delimiter = QString::null 
)

Graph::graphLoad Our almost universal network loader. :) It creates a new Parser object, moves it to a another thread, connects signals and slots and calls its run() method.

Parameters
m_fileName
m_codecName
m_showLabels
maxWidth
maxHeight
fileFormat
two_sm_mode
Returns
bool Graph::graphLoaded ( ) const
void Graph::graphLoadedTerminateParserThreads ( QString  reason)
slot
void Graph::graphMatrixAdjacencyCreate ( const bool  dropIsolates = false,
const bool  considerWeights = true,
const bool  inverseWeights = false,
const bool  symmetrize = false 
)
bool Graph::graphMatrixAdjacencyInvert ( const QString &  method = "lu")
void Graph::graphMatrixDissimilaritiesCreate ( Matrix INPUT_MATRIX,
Matrix DSM,
const int &  metric,
const QString &  varLocation,
const bool &  diagonal,
const bool &  considerWeights 
)

Calls Matrix:distancesMatrix to compute the dissimilarities matrix DSM of the variables (rows, columns, both) in given input matrix using the user defined metric.

Parameters
AM
DSM
metric
varLocation
diagonal
considerWeights
void Graph::graphMatrixDistancesCreate ( const bool &  computeCentralities = false,
const bool &  considerWeights = false,
const bool &  inverseWeights = true,
const bool &  dropIsolates = false 
)

Computes the distance matrix, DM, with geodesic distances between all vertices: DM(i,j)=geodesic distance between vertex i and vertex j In the process, it also computes many other matrices and metrics:

  • The so-called sigma matrix, named TM, where TM(i,j) is the number of shortest paths from vertex i to vertex j, called sigma(i,j).
  • The reachability matrix X^R where the {i,j} element is 1 if the vertices i and j are reachable, otherwise 0.
  • The Diameter of the graph, m_graphDiameter, which is the length of the longest shortest path between every (i,j)
  • The Eccentricity of every node i which is the length of the longest shortest path from i to every other node j
  • The InfluenceRange and InfluenceDomain of each node.
  • The centralities for every u in V (if centralities=true):
    • Betweenness: BC(u) = Sum ( sigma(i,j,u)/sigma(i,j) ) for every s,t in V
    • Stress: SC(u) = Sum ( sigma(i,j) ) for every s,t in V
    • Eccentricity: EC(u) = 1/maxDistance(u,t) for some t in V
    • Closeness: CC(u) = 1 / Sum( DM(u,t) ) for every t in V
    • Power:
      Parameters
      centralities
      considerWeights
      inverseWeights
      dropIsolates
void Graph::graphMatrixSimilarityMatchingCreate ( Matrix AM,
Matrix SCM,
const int &  measure = METRIC_SIMPLE_MATCHING,
const QString &  varLocation = "Rows",
const bool &  diagonal = false,
const bool &  considerWeights = true 
)

Calls Matrix:similarityMatrix to compute the similarity matrix SCM of the variables (rows, columns, both) in given input matrix using the selected matching measure.

Parameters
AM
SCM
rows
void Graph::graphMatrixSimilarityPearsonCreate ( Matrix AM,
Matrix PCC,
const QString &  varLocation = "Rows",
const bool &  diagonal = false 
)

The Pearson product-moment correlation coefficient (PPMCC, PCC or Pearson's r) is a measure of the linear dependence between two variables X and Y.

As a normalized version of the covariance, the PPMCC is computed with the formula: r ={ ^n _{i=1}(x_i - {x})(y_i - {y})}{{ ^n _{i=1}(x_i - {x})^2} { ^n _{i=1}(y_i - {y})^2}}

It gives a value between +1 and −1 inclusive, where 1 is total positive linear correlation, 0 is no linear correlation, and −1 is total negative linear correlation.

In SNA, Pearson correlations can be used to track the similarity between actors, in terms of structural equivalence.

This method creates an actor by actor NxN matrix PCC where the (i,j) element is the Pearson correlation coefficient of actor i and actor j. If the input matrix is the adjacency matrix, the PCC of two nodes measures how related (similar, inverse or not related at all) their patterns of ties tend to be. A positive value means there is strong linear association of the two actors, while a negative value means the inverse. For instance a value of -1 means the two actors have exactly opposite ties to other actors, while a value of 1 means the actors have identical patterns of ties to other actors (they are connected to the same actors).

The correlation measure of similarity is particularly useful when the data on ties are valued

Parameters
AM
PCC
rows
int Graph::graphMatrixStrToType ( const QString &  matrix) const

Helper method, return the matrix type of human readable matrix name .

Parameters
matrix
Returns
QString Graph::graphMatrixTypeToString ( const int &  matrixType) const

Helper method, return the human readable name of matrix type.

Parameters
matrix
int Graph::graphMetricStrToType ( const QString &  metricStr) const

Helper method, return the identifier of a metric.

Parameters
metricStr
QString Graph::graphMetricTypeToString ( const int &  metricType) const

Helper method, return the human readable name of metric type.

Parameters
metric
bool Graph::graphModified ( ) const

Graph::graphModified Returns true of graph is modified (edges/vertices added/removed). else false.

Returns
void Graph::graphModifiedSet ( const int &  graphNewStatus,
const bool &  signalMW = true 
)

Graph::graphModifiedSet.

Parameters
graphChangedFlag
signalMW
QString Graph::graphName ( ) const

Graph::graphName If m_graphName is set on file loading, it returns that. If m_graphName is empty, then returns current relation name If m_graphName is empty and there is no current relation name, then returns "noname".

Returns
void Graph::graphSave ( const QString &  fileName,
const int &  fileType,
const bool &  saveEdgeWeights = true 
)

Graph::graphSave Our almost universal graph saver. :) Actually it just checks the requested file type and calls the right saveGraphTo...() method.

Parameters
fileName
fileType
Returns
bool Graph::graphSaved ( ) const
bool Graph::graphSaveToAdjacencyFormat ( const QString &  fileName,
const bool &  saveEdgeWeights = true 
)

Graph::graphSaveToAdjacencyFormat.

Parameters
fileName
Returns
bool Graph::graphSaveToDotFormat ( QString  fileName)
bool Graph::graphSaveToGraphMLFormat ( const QString &  fileName,
QString  networkName = "",
int  maxWidth = 0,
int  maxHeight = 0 
)
bool Graph::graphSaveToPajekFormat ( const QString &  fileName,
QString  networkName = "",
int  maxWidth = 0,
int  maxHeight = 0 
)

Saves the active graph to a Pajek-formatted file Preserves node properties (positions, colours, etc)

QList< SelectedEdge > Graph::graphSelectedEdges ( ) const

Returns a QList of user-selected edges in pair<int,int>

Returns
int Graph::graphSelectedEdgesCount ( ) const

Returns count of user-selected edges.

Returns
QList< int > Graph::graphSelectedVertices ( ) const

Returns a QList of user-selected vertices.

Returns
int Graph::graphSelectedVerticesCount ( ) const

Returns count of user-selected vertices.

Returns
int Graph::graphSelectedVerticesMax ( ) const

Returns max of user-selected vertices.

Returns
int Graph::graphSelectedVerticesMin ( ) const

Returns min of user-selected vertices.

Returns
void Graph::graphSelectionChanged ( const QList< int > &  selectedVertices,
const QList< SelectedEdge > &  selectedEdges 
)

Gets updates on the user-selected vertices and edges from GW and emits their counts to MW.

Parameters
selectedVertices
selectedEdges
bool Graph::graphSymmetric ( )

Graph::graphSymmetric Returns TRUE if the adjacency matrix of the current relation is symmetric.

Returns
bool
void Graph::graphSymmetrize ( )

Graph::graphSymmetrize Transforms the graph to symmetric (all edges reciprocal)

void Graph::graphSymmetrizeStrongTies ( const bool &  allRelations = false)

Graph::graphSymmetrizeStrongTies.

Parameters
allRelations
bool Graph::graphTriadCensus ( )

Graph::graphTriadCensus Conducts a triad census and updates QList::triadTypeFreqs, which is the list carrying all triad type frequencies Complexity:O(n!)

Returns
bool Graph::graphUndirected ( )
void Graph::graphUndirectedSet ( const bool &  toggle,
const bool &  signalMW = true 
)

Graph::undirected Transforms the graph to undirected.

void Graph::graphWalksMatrixCreate ( const int &  vertices = 0,
const int &  length = 0,
const bool &  updateProgress = false 
)

Computes either the "Walks of given length" or the "Total Walks" matrix. If length>0, it computes the Walks of given length matrix, XM=AM^l where each element (i,j) denotes the number of walks of length l between vertex i and j. If length=0, it computes the Total Walks matrix, XSM=Sum{AM^n} where each (i,j) denotes the total number of walks of any length between vertices i and j. NOTE: In the latter case, this function is VERY SLOW on large networks (n>50), since it will calculate all powers of the sociomatrix up to n-1 in order to find out all possible walks.

Parameters
length
updateProgress
bool Graph::graphWeighted ( )

Graph::graphWeighted Checks if the graph is weighted (valued), i.e. if any e in |E| has value not 0 or 1 Complexity: O(n^2)

Returns
QString Graph::htmlEscaped ( QString  str) const
slot

Helper method, returns a nice qstring where all html special chars are encoded.

Parameters
str
Returns
void Graph::layoutCircularByProminenceIndex ( double  x0,
double  y0,
double  maxRadius,
int  prominenceIndex,
const bool  considerWeights,
const bool  inverseWeights,
const bool  dropIsolates 
)

Graph::layoutCircularByProminenceIndex Repositions all nodes on the periphery of different circles with radius analogous to their prominence index.

Parameters
x0
y0
maxRadius
prominenceIndex
considerWeights
inverseWeights
dropIsolates
void Graph::layoutCircularRandom ( double  x0,
double  y0,
double  maxRadius 
)

Graph::layoutCircularRandom Repositions all nodes on the periphery of different circles with random radius.

Parameters
x0
y0
maxRadius
void Graph::layoutForceDirected_Eades_moveNodes ( const qreal &  c4)
qreal Graph::layoutForceDirected_F_att ( const QString  model,
const qreal &  dist,
const qreal &  optimalDistance 
)
qreal Graph::layoutForceDirected_F_rep ( const QString  model,
const qreal &  dist,
const qreal &  optimalDistance 
)
void Graph::layoutForceDirected_FR_moveNodes ( const qreal &  temperature)

Graph::layoutForceDirected_FR_moveNodes.

Parameters
temperature
qreal Graph::layoutForceDirected_FR_temperature ( const int  iteration) const

Graph::layoutForceDirected_FR_temperature Reduces the temperature as the layout approaches a better configuration.

Returns
qreal temperature
void Graph::layoutForceDirectedFruchtermanReingold ( const int  maxIterations)

Graph::layoutForceDirectedFruchtermanReingold.

Parameters
maxIterationsFruchterman and Reingold (1991) refined the Spring Embedder model by replacing the forces. In this model, "the vertices behave as atomic particles or celestial bodies, exerting attractive and repulsive forces on one another." (ibid). Again, only vertices that are neighbours attract each other but, unlike Spring Embedder, all vertices repel each other. These forces induce movement. The algorithm might resemble molecular or planetary simulations, sometimes called n-body problems.
void Graph::layoutForceDirectedKamadaKawai ( const int  maxIterations)

Graph::layoutForceDirectedKamadaKawai In this model, the graph is considered to be a dynamic system where every two vertices are connected by a 'spring'. Each spring has a desirable length, which corresponds to their graph theoretic distance. In this way, the optimal layout of the graph is the state with the minimum imbalance. The degree of imbalance is formulated as the total spring energy: the square summation of the differences between desirable distances and real ones for all pairs of vertices.

Returns
qreal temperature
void Graph::layoutForceDirectedSpringEmbedder ( const int  maxIterations)

Graph::layoutForceDirectedSpringEmbedder.

Parameters
maxIterationsThe Spring Embedder model (Eades, 1984), part of the Force Directed Placement (FDP) family, assigns forces to all vertices and edges, as if nodes were electrically charged particles (Coulomb's law) and all edges were springs (i.e. Hooke's law).

These forces are applied to the nodes iteratively, pulling them closer together or pushing them further apart, until the system comes to an equilibrium state (node positions do not change anymore).

Note that, following Eades, we do not need to have a faithful simulation; we can -and we do- apply unrealistic forces in an unrealistic manner. For instance, instead of the forces described by Hooke's law, we will assume weaker logarithmic forces between far apart vertices...

compute max spring length as function of canvas area divided by the total vertices area

calculate electric (repulsive) forces between all vertices.

calculate spring forces between adjacent nodes that pull them together (if d > naturalLength) or push them apart (if d < naturalLength)

void Graph::layoutLevelByProminenceIndex ( double  maxWidth,
double  maxHeight,
int  prominenceIndex,
const bool  considerWeights,
const bool  inverseWeights,
const bool  dropIsolates 
)

Graph::layoutLevelByProminenceIndex Repositions all nodes on different top-down levels according to their centrality Emits setNodePos(i, x,y) to tell GW that the node item should be moved.

Parameters
maxWidth
maxHeight
prominenceIndex
considerWeights
inverseWeights
dropIsolates
void Graph::layoutRandom ( )

Graph::layoutRandom Repositions all nodes on different random positions Emits setNodePos(i, x,y) to tell GW that the node item should be moved.

Parameters
maxWidth
maxHeight
void Graph::layoutVerticesSizeByProminenceIndex ( int  prominenceIndex,
const bool  considerWeights,
const bool  inverseWeights,
const bool  dropIsolates 
)

Graph::layoutVerticesSizeByProminenceIndex changes the node size to be proportinal to given prominence index.

Parameters
prominenceIndex
void Graph::minmax ( float  C,
Vertex v,
float &  max,
float &  min,
int &  maxNode,
int &  minNode 
)
private

minmax() facilitates the calculations of minimum and maximum centralities during graphMatrixDistancesCreate()

float Graph::numberOfTriples ( int  v1)

Returns the number of triples of vertex v1 A triple Υ at a vertex v is a path of length two for which v is the center vertex.

void Graph::operateSpider ( )
signal

Signals to Crawler threads

void Graph::prestigeDegree ( const bool &  weights,
const bool &  dropIsolates = false 
)

Graph::prestigeDegree Calculates Degree Prestige (in-degree) of each vertex - diagonal included Also the mean value and the variance of the in-degrees.

Parameters
weights
dropIsolates
void Graph::prestigePageRank ( const bool &  dropIsolates = false)

Graph::prestigePageRank Calculates the PageRank Prestige of each vertex.

Parameters
dropIsolates
void Graph::prestigeProximity ( const bool  considerWeights = false,
const bool  inverseWeights = false,
const bool  dropIsolates = false 
)

Graph::prestigeProximity Calculates Proximity Prestige of each vertex Also the mean value and the variance of it..

void Graph::randomizeThings ( )

Graph::randomizeThings Adds a little universal randomness :)

RANDOM NETWORKS

void Graph::randomNetErdosCreate ( const int &  vert,
const QString &  model,
const int &  edges,
const float &  eprob,
const QString &  mode,
const bool &  diag 
)

Graph::randomNetErdosCreate.

Parameters
vert
model
edges
eprob
mode
diagCreate an erdos-renyi random network according to the given model
void Graph::randomNetRegularCreate ( const int &  vert,
const int &  degree,
const QString &  mode,
const bool &  diag 
)

Graph::randomNetRegularCreate Creates a random network where nodes have the same degree.

Parameters
vert
degree
void Graph::randomNetRingLatticeCreate ( const int &  vert,
const int &  degree,
const bool  updateProgress = false 
)

Graph::randomNetRingLatticeCreate Creates a random ring lattice network.

Parameters
vert
degree
x0
y0
radius
updateProgress
void Graph::randomNetScaleFreeCreate ( const int &  n,
const int &  power,
const int &  m0,
const int &  m,
const float &  alpha,
const QString &  mode 
)
void Graph::randomNetSmallWorldCreate ( const int &  vert,
const int &  degree,
const double &  beta,
const QString &  mode 
)

Graph::randomNetSmallWorldCreate Creates a small world network.

Parameters
vert
degree
beta
int Graph::reachable ( const int &  v1,
const int &  v2 
)

Calculates and returns non-zero if vertices v1 and v2 are reachable. If v1, v2 are reachable it returns the geodesic distance. This method is actually a reachability test (if it returns non-zero)

void Graph::relationAdd ( const QString &  relName,
const bool &  changeRelation = false 
)

Graph::relationAdd Adds a new relation named relName Called by file parser to add a new relation Also called from MW. emits signalRelationAddToMW.

Parameters
relName
int Graph::relationCurrent ( )
slot

Returns current relation index.

Returns
int current relation index
QString Graph::relationCurrentName ( ) const
slot

Returns current relation.

Returns
string current relation name
void Graph::relationCurrentRename ( const QString &  newName,
const bool &  notifyMW = false 
)
slot

Graph::relationCurrentRename.

Parameters
newName
void Graph::relationNext ( )
slot

Graph::slotEditRelationNext Increases the index of editRelationChangeCombo which signals to Graph::relationSet()

void Graph::relationPrev ( )
slot

Graph::slotEditRelationPrev Decreases the index of editRelationChangeCombo which signals to Graph::relationSet()

int Graph::relations ( )

Graph::relations.

Returns
Returns the number of relationships in this Graph
void Graph::relationsClear ( )

Graph::relationsClear.

Returns
Clears relationships in this Graph
void Graph::relationSet ( int  index = RAND_MAX,
const bool  notifyMW = true 
)
slot

Graph::relationSet Changes m_curRelation to index. If index==RAND_MAX, changes to last added relation. Then calls Vertex::relationSet() for all enabled vertices, to disable edges of the old relation and enable edges of the new relation Then, if notifyMW==TRUE, it signals signalRelationChangedToGW(int), which disables/enables the on screen edges, and Called from MW when the user selects a relation in the combo box. Also called from Parser.

Slots to signals from MainWindow

Parameters
indexint
notifyMWbool
void Graph::resolveClasses ( float  C,
H_StrToInt discreteClasses,
int &  classes 
)
private

This method calculates the number of discrete centrality classes of all vertices It stores that number in a QHash<QString,int> type where the centrality value is the key. Called from graphMatrixDistancesCreate()

void Graph::resolveClasses ( float  C,
H_StrToInt discreteClasses,
int &  classes,
int  name 
)
private
void Graph::setEdgeColor ( const long int &  v1,
const long int &  v2,
const QString &  color 
)
signal
void Graph::setEdgeLabel ( const long int &  v1,
const long int &  v2,
const QString &  label 
)
signal
void Graph::setEdgeUndirected ( const long int &  v1,
const long int &  v2,
const float &  weight 
)
signal
void Graph::setEdgeVisibility ( int  ,
int  ,
int  ,
bool   
)
signal
void Graph::setEdgeWeight ( const long int &  v1,
const long int &  v2,
const float &  weight 
)
signal
void Graph::setNodeColor ( const long int  v,
const QString &  color 
)
signal
void Graph::setNodeLabel ( long  int,
QString   
)
signal
void Graph::setNodeLabelColor ( const long int &  ,
const QString &  color 
)
signal
void Graph::setNodeLabelDistance ( const long int &  ,
const int &   
)
signal
void Graph::setNodeLabelSize ( const long int &  ,
const int &   
)
signal
void Graph::setNodeNumberDistance ( const long int &  ,
const int &   
)
signal
void Graph::setNodeNumberSize ( const long int &  ,
const int &   
)
signal
void Graph::setNodePos ( const int &  ,
const qreal &  ,
const qreal &   
)
signal
void Graph::setNodeShape ( const long int  v,
const QString &  shape 
)
signal
void Graph::setNodeSize ( const long int &  v,
const int &  size 
)
signal
void Graph::setSocNetV_Version ( QString  ver)
inline
void Graph::setVertexVisibility ( long  int,
bool   
)
signal
int Graph::sign ( const qreal &  D)

Graph::sign returns the sign of number D as integer (1 or -1)

Parameters
D
Returns
void Graph::signalDatasetDescription ( QString  )
signal
void Graph::signalEdgeClickedInfo ( const long int &  v1 = 0,
const long int &  v2 = 0,
const float &  weight = 0,
const bool &  undirected = false 
)
signal
void Graph::signalGraphLoaded ( const int &  fileType,
const QString &  fileName = QString::null,
const QString &  netName = QString::null,
const int &  totalNodes = 0,
const int &  totalLinks = 0,
const QString &  message = QString::null 
)
signal
void Graph::signalGraphModified ( const int &  graphStatus,
const bool &  undirected,
const int &  vertices,
const int &  edges,
const float &  density 
)
signal
void Graph::signalGraphSaved ( const int &  status)
signal
void Graph::signalNodeClickedInfo ( const int &  number = 0,
const QPointF &  p = QPointF(),
const QString &  label = QString::null,
const int &  inDegree = 0,
const int &  outDegree = 0,
const float &  clc = 0 
)
signal
void Graph::signalNodeSizesByInDegree ( bool  )
signal
void Graph::signalNodeSizesByOutDegree ( bool  )
signal
void Graph::signalRelationAddToMW ( const QString &  newRelation,
const bool &  changeRelation = true 
)
signal
void Graph::signalRelationChangedToGW ( int  )
signal
void Graph::signalRelationChangedToMW ( const int &  relIndex = RAND_MAX)
signal
void Graph::signalRelationRenamedToMW ( const QString  newRelName)
signal
void Graph::signalRelationsClear ( )
signal
void Graph::signalSelectionChanged ( const int &  selectedVertices,
const int &  selectedEdges 
)
signal
void Graph::statusMessage ( const QString &  message)
signal
void Graph::timerEvent ( QTimerEvent *  event)
protected

This method is automatically invoked when a QTimerEvent occurs UNUSED

void Graph::triadType_examine_MAN_label ( int  mut,
int  asy,
int  nul,
Vertex vert1,
Vertex vert2,
Vertex vert3 
)

Examines the triad type (in Mutual-Asymmetric-Null label format) and increases by one the proper frequency element inside QList::triadTypeFreqs

void Graph::updateProgressDialog ( int  )
signal

Signals to MainWindow

void Graph::vertexAdd ( const int &  v1,
const int &  val,
const int &  size,
const QString &  color,
const QString &  numColor,
const int &  numSize,
const QString &  label,
const QString &  labelColor,
const int &  labelSize,
const QPointF &  p,
const QString &  shape 
)
private

Adds a Vertex named v1, valued val, sized nszm colored nc, labeled nl, labelColored lc, shaped nsp, at point p. This method is called by vertexCreate() method.

private member functions

Parameters
v1
val
size
color
numColor
numSize
label
labelColor
labelSize
p
shape
int Graph::vertexClicked ( ) const

Graph::vertexClicked.

Returns
int
void Graph::vertexClickedSet ( const int &  v1)
slot

Graph::vertexClickedSet.

Parameters
v1Called from GW::userClickedNode(int) to update clicked vertex number and signal signalNodeClickedInfo(node info) to MW which shows node info on the status bar.
QColor Graph::vertexColor ( const long int &  v1)

Graph::vertexColor.

Parameters
v1
Returns
void Graph::vertexColorAllSet ( const QString &  color)

Graph::vertexColorAllSet Changes the color of all vertices and updates default vertex color.

Parameters
color
void Graph::vertexColorInit ( const QString &  color)

Graph::vertexColorInit default vertex color initialization.

Parameters
color
void Graph::vertexColorSet ( const long &  v,
const QString &  color 
)

Graph::vertexColorSet Changes the color of vertex v1.

Parameters
v1
color
void Graph::vertexCreate ( const int &  num,
const int &  nodeSize,
const QString &  nodeColor,
const QString &  numColor,
const int &  numSize,
const QString &  label,
const QString &  labelColor,
const int &  labelSize,
const QPointF &  p,
const QString &  nodeShape,
const bool &  signalMW 
)
slot

Graph::vertexCreate Main vertex creation slot, associated with homonymous signal from Parser. Adds a Vertex to the Graph and calls editNodeAdd of GraphicsWidget The new Vertex is named i and stores its color, label, label color, shape and position p. p holds the desired position of the new node.

Slots to signals from Parser

Parameters
num
size
nodeColor
numColor
numSize
label
lColor
lSize
p
nodeShape
signalMW
void Graph::vertexCreateAtPos ( const QPointF &  p)
slot

Graph::vertexCreateAtPos.

Parameters
pThe clicked pos of the new node.

Called from GW, with i and p as parameters. Calls the main creation slot with init node values.

void Graph::vertexCreateAtPosRandom ( const bool &  signalMW = false)
slot

Graph::vertexCreateAtPosRandom.

Parameters
iCreates a new random positioned vertex Called from MW only Computes a random position p inside the useable canvas area Then calls the main creation slot with init node values.
void Graph::vertexCreateAtPosRandomWithLabel ( const int &  i,
const QString &  label,
const bool &  signalMW = false 
)
slot

Graph::vertexCreateAtPosRandomWithLabel.

Parameters
i
labelCreates a new random positioned vertex with number i and label Called from WebCrawler and Parser with parameters label and i. Computes a random position p the useable canvas area Then calls the main creation slot with init node values.
int Graph::vertexDegreeIn ( int  v1)

Graph::vertexDegreeIn Returns the inDegree (sum of inbound edge weights) of vertex v1.

Parameters
v1
Returns
int Graph::vertexDegreeOut ( int  v1)

Graph::vertexDegreeOut Returns the outDegree (sum of outbound edge weights) of vertex v1.

Parameters
v1
Returns
int Graph::vertexEdgesInbound ( int  v1)

Graph::vertexEdgesInbound Returns the number of inbound edges (arcs) to vertex v1.

Parameters
v1
Returns
int
int Graph::vertexEdgesOutbound ( int  v1)

Graph::vertexEdgesOutbound *Returns the number of outbound edges (arcs) from vertex v1.

Parameters
v1
Returns
int Graph::vertexExists ( const long int &  v1)

Graph::vertexExists Checks if there is a specific vertex in the graph. Returns the index or -1 Complexity: O(logN) for index retrieval.

Parameters
num
Returns
int Graph::vertexExists ( const QString &  label)

Graph::vertexExists Checks if there is a vertex with a specific label in the graph Returns the index or -1 Complexity: O(N)

Parameters
label
Returns
index or -1
QList< int > Graph::vertexinfluenceDomain ( int  v1)

Graph::vertexinfluenceDomain Returns the influence domain of vertex v1, namely the set of nodes who can reach v1 This function applies to digraphs only.

Parameters
v1
Returns
QList< int > Graph::vertexinfluenceRange ( int  v1)

Returns the influence range of vertex v1, namely the set of nodes who are reachable by v1 (See Wasserman and Faust, pp.200-201, based on Lin, 1976). This function is for digraphs only

bool Graph::vertexIsolated ( const long int &  v1) const

Graph::vertexIsolated.

Parameters
v1
Returns
void Graph::vertexIsolateFilter ( bool  filterFlag)
slot

Graph::vertexIsolateFilter Called from filterOrphanNodes via MainWindow to filter nodes with no links For each orphan Vertex in the Graph, emits the filterVertex()

Parameters
filterFlag
QString Graph::vertexLabel ( const long int &  v1)

Graph::vertexLabel Returns the label of a vertex v1.

Parameters
v1
Returns
void Graph::vertexLabelColorAllSet ( const QString &  color)

Graph::vertexLabelColorAllSet Changes the label color of all vertices.

Parameters
size
void Graph::vertexLabelColorInit ( QString  color)

Graph::vertexLabelColorInit Changes the default vertex label color.

Parameters
color
void Graph::vertexLabelColorSet ( int  v1,
QString  color 
)

Graph::vertexLabelColorSet Changes the label color of vertex v1.

Parameters
v1
color
void Graph::vertexLabelDistanceAllSet ( const int &  newDistance)

Graph::vertexLabelDistanceAllSet Changes the distance.of all vertex labels from their vertices.

Parameters
size
void Graph::vertexLabelDistanceInit ( const int &  distance)

Graph::vertexLabelDistanceInit Changes the default distance of vertex labels.

Parameters
distance
void Graph::vertexLabelDistanceSet ( const long int &  v,
const int &  newDistance 
)

Graph::vertexLabelDistanceSet Changes the distance.of vertex v label from the vertex.

Parameters
v
size
void Graph::vertexLabelSet ( int  v1,
QString  label 
)

Graph::vertexLabelSet Changes the label of a vertex v1.

Parameters
v1
label
void Graph::vertexLabelSizeAllSet ( const int &  size)

Graph::vertexLabelSizeAllSet Changes the label size of all vertices.

Parameters
size
void Graph::vertexLabelSizeInit ( int  newSize)

Graph::vertexLabelSizeInit Changes the default size of vertex labels.

Parameters
newSize
void Graph::vertexLabelSizeSet ( const long int &  v1,
const int &  size 
)

Graph::vertexLabelSizeSet Changes the label size of vertex v1.

Parameters
v1
size
void Graph::vertexLabelsVisibilitySet ( bool  toggle)
QList< int > Graph::vertexNeighborhoodList ( const int &  v1)

Graph::vertexNeighborhoodList.

Parameters
v1
Returns
QList<int>
void Graph::vertexNumberColorInit ( QString  color)

Graph::vertexNumberColorInit Changes the initial color of vertices numbers.

Parameters
color
void Graph::vertexNumberDistanceInit ( const int &  distance)
void Graph::vertexNumberDistanceSet ( const long int &  v,
const int &  newDistance 
)

Graph::vertexNumberDistanceSet Changes the distance.of vertex v number from the vertex.

Parameters
v
size
void Graph::vertexNumberDistanceSetAll ( const int &  newDistance)

Graph::vertexNumberDistanceSetAll Changes the distance.of all vertex number from their vertices.

Parameters
size
int Graph::vertexNumberMax ( )

Graph::vertexNumberMax Returns the name of the last vertex. Used by slotEditNodeRemove of MW.

Returns
int
int Graph::vertexNumberMin ( )

Graph::vertexNumberMin Returns the name of the first vertex. Used by slotRemoveNode of MW.

Returns
int
void Graph::vertexNumbersInsideNodesSet ( bool  toggle)
void Graph::vertexNumberSizeInit ( const int &  size)

Graph::vertexNumberSizeInit Changes the initial size of vertices numbers.

Parameters
size
void Graph::vertexNumberSizeSet ( const long int &  v,
const int &  size 
)

Graph::vertexNumberSizeSet Changes the size.of vertex v number.

Parameters
v
size
void Graph::vertexNumberSizeSetAll ( const int &  size)
void Graph::vertexNumbersVisibilitySet ( bool  toggle)
QPointF Graph::vertexPos ( const int &  v1)

Graph::vertexPos.

Parameters
v1
Returns
void Graph::vertexPosSet ( const int &  v1,
const int &  x,
const int &  y 
)

Graph::vertexPosSet Called from MW/GW when node moves to update its position.

Parameters
v1
x
y
void Graph::vertexRemove ( long int  Doomed)

Graph::vertexRemove Removes the vertex named Doomed from the graph First, it removes all edges to Doomed from other vertices Then it changes the index of all subsequent vertices inside m_graph Finally, it removes the vertex.

Parameters
Doomed
void Graph::vertexRemoveDummyNode ( int  i)
slot

Deletes any dymmy nodes This is called from loadPajek method of Parser in order to delete any redundant (dummy) nodes.

Parameters
[in]inumber of node
QString Graph::vertexShape ( const int &  v1)

Graph::vertexShape Returns the shape of this vertex.

Parameters
v1
Returns
void Graph::vertexShapeAllSet ( const QString  shape)

Graph::vertexShapeAllSet Changes the shape.of all vertices.

Parameters
shape
void Graph::vertexShapeInit ( const QString  shape)

Graph::vertexShapeInit.

Parameters
shape
void Graph::vertexShapeSet ( const int  v1,
const QString  shape 
)

Graph::vertexShapeSet Changes the shape.of vertex v.

Parameters
v1
shape
int Graph::vertexSize ( const long int &  v)

Graph::vertexSize.

Parameters
v
Returns
int
void Graph::vertexSizeAllSet ( const int  size)

Graph::vertexSizeAllSet Changes the size.of all vertices.

Parameters
size
void Graph::vertexSizeInit ( const long int  size)

Graph::vertexSizeInit Initialization function.

Parameters
size
void Graph::vertexSizeSet ( const long int &  v,
const int &  size 
)

Graph::vertexSizeSet Changes the size.of vertex v Called from MW Node Properties.

Parameters
v
size
int Graph::vertices ( const bool  dropIsolates = false,
const bool  countAll = false 
)

Graph::vertices Returns |V| of graph If countAll = true, returns |V| where V the set of all enabled or not vertices If countAll = false, it skips disabled vertices If countAll = false and dropIsolates = true, it skips both disabled and isolated vertices.

Parameters
dropIsolates
countAll
Returns
void Graph::verticesCreateSubgraph ( QList< int >  vList,
const int &  type = SUBGRAPH_CLIQUE,
const int &  center = 0 
)

Creates a subgraph (clique, star, cycle, line) with vertices in vList Iff vList is empty, then fallbacks to the m_selectedVertices.

Parameters
vList
QList< int > Graph::verticesList ( )

Returns a list of all vertices numbers inside the graph.

Returns
QList< int > Graph::verticesListIsolated ( )
QSet< int > Graph::verticesSet ( )

Returns a QSet of all vertices numbers inside the graph.

Returns
int Graph::verticesWithInboundEdges ( )

Returns the sum of vertices having edgesInbound

int Graph::verticesWithOutboundEdges ( )

Returns the sum of vertices having edgesOutbound

int Graph::verticesWithReciprocalEdges ( )

Returns the sum of vertices having reciprocal edges

int Graph::walksBetween ( int  v1,
int  v2,
int  length 
)

Graph::walksBetween Calculates and returns the number of walks of a given length between v1 and v2.

Parameters
v1
v2
length
Returns
void Graph::webCrawl ( QString  seed,
int  maxNodes,
int  maxRecursion,
bool  extLinks,
bool  intLinks 
)
slot
void Graph::webCrawlTerminateThreads ( QString  reason)
void Graph::writeCentralityBetweenness ( const QString  fileName,
const bool  considerWeights,
const bool  inverseWeights,
const bool  dropIsolates 
)

Writes Betweeness centralities to file.

Parameters
fileName
considerWeights
inverseWeights
dropIsolates
void Graph::writeCentralityCloseness ( const QString  fileName,
const bool  considerWeights,
const bool  inverseWeights,
const bool  dropIsolates 
)

Writes the closeness centralities to a file.

Parameters
fileName
considerWeights
inverseWeights
dropIsolates
void Graph::writeCentralityClosenessInfluenceRange ( const QString  fileName,
const bool  weights,
const bool  inverseWeights,
const bool  dropIsolates 
)
void Graph::writeCentralityDegree ( const QString  fileName,
const bool  considerWeights,
const bool  dropIsolates 
)

Graph::writeCentralityDegree.

Parameters
fileName
considerWeights
dropIsolates
void Graph::writeCentralityEccentricity ( const QString  fileName,
const bool  considerWeights,
const bool  inverseWeights,
const bool  dropIsolates 
)

Graph::writeCentralityEccentricity.

Parameters
fileName
considerWeights
inverseWeights
dropIsolates
void Graph::writeCentralityEigenvector ( const QString  fileName,
const bool &  weigths = true,
const bool &  inverseWeights = false,
const bool &  dropIsolates = false 
)
void Graph::writeCentralityInformation ( const QString  fileName,
const bool  weigths,
const bool  inverseWeights 
)
void Graph::writeCentralityPower ( const QString  fileName,
const bool  considerWeights,
const bool  inverseWeights,
const bool  dropIsolates 
)

Graph::writeCentralityPower.

Parameters
fileName
considerWeights
inverseWeights
dropIsolates
void Graph::writeCentralityStress ( const QString  fileName,
const bool  weigths,
const bool  inverseWeights,
const bool  dropIsolates 
)
void Graph::writeCliqueCensus ( const QString  fileName,
const bool  considerWeights 
)

Graph::writeCliqueCensus Writes the number of cliques (maximal connected subgraphs) of each vertex into a given file.

Parameters
fileName
considerWeights
void Graph::writeClusteringCoefficient ( const QString  fileName,
const bool  considerWeights 
)

Graph::writeClusteringCoefficient Writes the clustering coefficients to a file.

Parameters
fileName
considerWeights
void Graph::writeClusteringHierarchical ( const QString &  fileName,
const QString &  matrix = "Adjancency",
const QString &  metric = "Manhattan",
const QString &  method = "Complete",
const bool &  diagonal = false,
const bool &  dendrogram = false,
const bool &  considerWeights = true,
const bool &  inverseWeights = false,
const bool &  dropIsolates = false 
)

Writes Hierarchical Clustering Analysis to a given file.

Parameters
fileName
matrix
similarityMeasure
method
considerWeights
inverseWeights
dropIsolates
void Graph::writeClusteringHierarchicalResultsToStream ( QTextStream &  outText,
const int  N,
const bool &  dendrogram = false 
)
void Graph::writeDataSetToFile ( const QString  dir,
const QString  fileName 
)

Graph::writeDataSetToFile Writes a known dataset to the given file.

Parameters
fileName
void Graph::writeEccentricity ( const QString  fileName,
const bool  considerWeights = false,
const bool  inverseWeights = false,
const bool  dropIsolates = false 
)

Graph::writeEccentricity.

Parameters
fileName
considerWeights
inverseWeights
dropIsolates
void Graph::writeMatrix ( const QString &  fn,
const int &  matrix = MATRIX_ADJACENCY,
const bool &  considerWeights = true,
const bool &  inverseWeights = false,
const bool &  dropIsolates = false,
const QString &  varLocation = "Rows",
const bool &  simpler = false 
)

Writes the specified matrix of social network to file fn

void Graph::writeMatrixAdjacency ( const QString  fn,
const bool &  markDiag = true 
)

Writes the adjacency matrix of G to a specified file fn

void Graph::writeMatrixAdjacencyInvert ( const QString &  filename,
const QString &  method 
)
void Graph::writeMatrixAdjacencyPlot ( const QString  fn,
const bool &  simpler = false 
)

Writes a visual representation of the adjacency matrix of G to a specified file fn This is called by MainWindow::slotViewAdjacencyMatrixPlotText() The resulting matrix HAS NO spaces between elements.

void Graph::writeMatrixAdjacencyTo ( QTextStream &  os,
const bool &  saveEdgeWeights = true 
)

Exports the adjacency matrix to a given textstream

void Graph::writeMatrixDegreeText ( const QString &  fn)

Computes the Degree matrix of the graph and writes it to given file.

Parameters
fn
void Graph::writeMatrixDissimilarities ( const QString  fileName,
const QString &  metricStr,
const QString &  varLocation,
const bool &  diagonal,
const bool &  considerWeights 
)

Writes dissimilarity matrix based on a metric/measure to given html file.

Parameters
fileName
measure
varLocation
diagonal
considerWeights
void Graph::writeMatrixDistancesPlainText ( const QString &  fn,
const bool &  considerWeights,
const bool &  inverseWeights,
const bool &  dropIsolates 
)

Graph::writeMatrixDistancesPlainText Writes the matrix of distances to a file.

Parameters
fn
considerWeights
inverseWeights
dropIsolates
void Graph::writeMatrixLaplacianPlainText ( const QString &  fn)

Computes the Laplacian matrix of the graph and writes it to given file.

Parameters
fn
void Graph::writeMatrixNumberOfGeodesicsPlainText ( const QString &  fn,
const bool &  considerWeights,
const bool &  inverseWeights 
)

Saves the number of geodesic distances matrix TM to a file

void Graph::writeMatrixSimilarityMatching ( const QString  fileName,
const QString &  measure = "Simple",
const QString &  matrix = "adjacency",
const QString &  varLocation = "rows",
const bool &  diagonal = false,
const bool &  considerWeights = true 
)

Writes similarity matrix based on a matching measure to given html file.

Parameters
fileName
measure
matrix
varLocation
diagonal
considerWeights
void Graph::writeMatrixSimilarityMatchingPlain ( const QString  fileName,
const int &  measure = METRIC_SIMPLE_MATCHING,
const QString &  matrix = "adjacency",
const QString &  varLocation = "rows",
const bool &  diagonal = false,
const bool &  considerWeights = true 
)

Writes similarity matrix based on a matching measure to given file.

Parameters
fileName
measure
matrix
varLocation
diagonal
considerWeights
void Graph::writeMatrixSimilarityPearson ( const QString  fileName,
const bool  considerWeights,
const QString &  matrix = "adjacency",
const QString &  varLocation = "rows",
const bool &  diagonal = false 
)

Calls Graph::graphMatrixSimilarityPearsonCreate() and writes Pearson Correlation Coefficients to given file.

Parameters
fileName
considerWeights
void Graph::writeMatrixSimilarityPearsonPlainText ( const QString  fileName,
const bool  considerWeights,
const QString &  matrix = "adjacency",
const QString &  varLocation = "rows",
const bool &  diagonal = false 
)

Calls Graph::graphSimilariyPearsonCorrelationCoefficients() and writes Pearson Correlation Coefficients to given file.

Parameters
fileName
considerWeights
void Graph::writeMatrixWalks ( const QString &  fn,
const int &  length = 0,
const bool &  simpler = false 
)

Calls graphWalksMatrixCreate() to compute walks and writes the Walks of given length matrix to a file in HTML. If length = 0, it writes the Total Walks matrix.

Parameters
fn
length
simpler
void Graph::writePrestigeDegree ( const QString  fileName,
const bool  considerWeights,
const bool  dropIsolates 
)

Graph::writePrestigeDegree.

Parameters
fileName
considerWeights
dropIsolates
void Graph::writePrestigePageRank ( const QString  fileName,
const bool  dropIsolates = false 
)

Graph::writePrestigePageRank Writes the PageRank indices to a file.

Parameters
fileName
dropIsolates
void Graph::writePrestigeProximity ( const QString  fileName,
const bool  considerWeights,
const bool  inverseWeights,
const bool  dropIsolates 
)

Graph::writePrestigeProximity Writes the proximity prestige indices to a file.

Parameters
fileName
considerWeights
inverseWeights
dropIsolates
void Graph::writeReachabilityMatrixPlainText ( const QString &  fn,
const bool &  dropIsolates = false 
)

Writes the reachability matrix X^R of the graph to a file

void Graph::writeTriadCensus ( const QString  fileName,
const bool  considerWeights 
)
void Graph::writeWalksOfLengthMatrixPlainText ( const QString &  fn,
const int &  length 
)
void Graph::writeWalksTotalMatrixPlainText ( const QString &  fn)

Graph::writeWalksTotalMatrixPlainText Writes the total number of walks matrix.

Parameters
fn
netName
length

Member Data Documentation

QDateTime Graph::actualDateTime
private
Matrix Graph::AM
private
float Graph::averageCLC
private
bool Graph::calculatedAdjacencyMatrix
private
bool Graph::calculatedCentralities
private
bool Graph::calculatedDC
private
bool Graph::calculatedDistances
private
bool Graph::calculatedDP
private
bool Graph::calculatedEdges
private
bool Graph::calculatedEVC
private
bool Graph::calculatedGraphDensity
private
bool Graph::calculatedGraphSymmetry
private
bool Graph::calculatedGraphWeighted
private
bool Graph::calculatedIC
private
bool Graph::calculatedIRCC
private
bool Graph::calculatedIsolates
private
bool Graph::calculatedPP
private
bool Graph::calculatedPRP
private
bool Graph::calculatedTriad
private
bool Graph::calculatedVertices
private
bool Graph::calculatedVerticesList
private
bool Graph::calculatedVerticesSet
private
int Graph::canvasHeight
private
int Graph::canvasWidth
private
int Graph::classesEC
private
int Graph::classesEccentricity
private
int Graph::classesEVC
private
int Graph::classesIC
private
int Graph::classesIRCC
private
int Graph::classesPP
private
int Graph::classesPRP
private
int Graph::classesSBC
private
int Graph::classesSCC
private
int Graph::classesSDC
private
int Graph::classesSDP
private
int Graph::classesSPC
private
int Graph::classesSSC
private
Matrix Graph::CLQM
private
float Graph::d_factor
private
float Graph::denomEC
private
float Graph::denomEVC
private
float Graph::denomIC
private
float Graph::denomIRCC
private
float Graph::denomPP
private
float Graph::denomPRC
private
float Graph::denomSBC
private
float Graph::denomSCC
private
float Graph::denomSPC
private
H_StrToInt Graph::discreteBCs
private
H_StrToInt Graph::discreteCCs
private
H_StrToInt Graph::discreteDPs
private

used in resolveClasses and graphMatrixDistancesCreate()

H_StrToInt Graph::discreteEccentricities
private
H_StrToInt Graph::discreteECs
private
H_StrToInt Graph::discreteEVCs
private
H_StrToInt Graph::discreteICs
private
H_StrToInt Graph::discreteIRCCs
private
H_StrToInt Graph::discretePCs
private
H_StrToInt Graph::discretePPs
private
H_StrToInt Graph::discretePRPs
private
H_StrToInt Graph::discreteSCs
private
H_StrToInt Graph::discreteSDCs
private
Matrix Graph::DM
private
float Graph::edgeReverseWeightTemp
private
float Graph::edgeWeightTemp
private
Parser* Graph::file_parser
private
QThread Graph::file_parserThread
private
QString Graph::fileName
private
int Graph::graphModifiedFlag
private

General & initialisation variables

float Graph::groupCC
private
float Graph::groupDC
private
float Graph::groupDP
private
float Graph::groupEC
private
float Graph::groupEVC
private
float Graph::groupIRCC
private
float Graph::groupPP
private
float Graph::groupSBC
private
float Graph::groupSC
private
float Graph::groupSPC
private
QString Graph::htmlEnd
private
QString Graph::htmlHead
private
QString Graph::htmlHeadLight
private
int Graph::inboundEdgesVert
private
H_Int Graph::index

index stores the real position of each vertex inside m_graph. It starts at zero (0). We need to know the place of a vertex inside m_graph after adding or removing many vertices

QHash<int, int> Graph::influenceDomains
private
QHash<int, int> Graph::influenceRanges
private
QString Graph::initEdgeColor
private
bool Graph::initEdgeLabels
private
bool Graph::initEdgeWeightNumbers
private
QString Graph::initVertexColor
private
QString Graph::initVertexLabelColor
private
int Graph::initVertexLabelDistance
private
int Graph::initVertexLabelSize
private
bool Graph::initVertexLabelsVisibility
private
QString Graph::initVertexNumberColor
private
int Graph::initVertexNumberDistance
private
bool Graph::initVertexNumberInside
private
int Graph::initVertexNumberSize
private
bool Graph::initVertexNumbersVisibility
private
QString Graph::initVertexShape
private
long int Graph::initVertexSize
private
Matrix Graph::invAM
private
Matrix Graph::invM
private
ClickedEdge Graph::m_clickedEdge
private
QMap<int, L_int > Graph::m_cliques
private
QList<float> Graph::m_clusteringLevel
private
QMap<int, V_str> Graph::m_clusterPairNamesPerSeq
private
QMap<QString, V_int> Graph::m_clustersByName
private
QMap<int, V_int> Graph::m_clustersPerSequence
private
int Graph::m_curRelation
private
int Graph::m_fieldWidth
private
int Graph::m_fileFormat
private
Vertices Graph::m_graph
private

List of pointers to the vertices. A vertex stores all the info: links, colours, etc

float Graph::m_graphAverageDistance
private
int Graph::m_graphConnectedness
private
float Graph::m_graphDensity
private
long int Graph::m_graphDiameter
private
QList<int> Graph::m_graphFileFormatExportSupported
private
float Graph::m_graphGeodesicsCount
private
QString Graph::m_graphName
private
QList<int> Graph::m_isolatedVerticesList
private
bool Graph::m_isWeighted
private
int Graph::m_precision
private
QList<QString> Graph::m_relationsList
private
QList<SelectedEdge> Graph::m_selectedEdges
private
QList<int> Graph::m_selectedVertices
private
bool Graph::m_symmetric
private
long int Graph::m_totalEdges
private
long int Graph::m_totalVertices
private
bool Graph::m_undirected
private
int Graph::m_vertexClicked
private
QHash<int, int> Graph::m_vertexPairsNotConnected
private
QHash<int, int> Graph::m_vertexPairsUnilaterallyConnected
private
QList<int> Graph::m_verticesList
private
QSet<int> Graph::m_verticesSet
private
float Graph::maxCLC
private
float Graph::maxEC
private
float Graph::maxEccentricity
private
float Graph::maxEVC
private
float Graph::maxIC
private
float Graph::maxIndexBC
private
float Graph::maxIndexCC
private
float Graph::maxIndexEC
private
float Graph::maxIndexIC
private
float Graph::maxIndexPC
private
float Graph::maxIndexSC
private
float Graph::maxIRCC
private
int Graph::maxNodeCLC
private
int Graph::maxNodeDP
private
int Graph::maxNodeEC
private
int Graph::maxNodeEccentricity
private
int Graph::maxNodeEVC
private
int Graph::maxNodeIC
private
int Graph::maxNodeIRCC
private
int Graph::maxNodePP
private
int Graph::maxNodePRP
private
int Graph::maxNodeSBC
private
int Graph::maxNodeSCC
private
int Graph::maxNodeSDC
private
int Graph::maxNodeSPC
private
int Graph::maxNodeSSC
private
float Graph::maxPP
private
float Graph::maxPRP
private
float Graph::maxSBC
private
float Graph::maxSCC
private
float Graph::maxSDC
private
float Graph::maxSDP
private
float Graph::maxSPC
private
float Graph::maxSSC
private
float Graph::meanEC
private
float Graph::meanEVC
private
float Graph::meanIC
private
float Graph::meanIRCC
private
float Graph::meanPP
private
float Graph::meanPRP
private
float Graph::meanSBC
private
float Graph::meanSCC
private
float Graph::meanSDC
private
float Graph::meanSDP
private
float Graph::meanSPC
private
float Graph::meanSSC
private
float Graph::minCLC
private
float Graph::minEC
private
float Graph::minEccentricity
private
float Graph::minEVC
private
float Graph::minIC
private
float Graph::minIRCC
private
int Graph::minNodeCLC
private
int Graph::minNodeDP
private
int Graph::minNodeEC
private
int Graph::minNodeEccentricity
private
int Graph::minNodeEVC
private
int Graph::minNodeIC
private
int Graph::minNodeIRCC
private
int Graph::minNodePP
private
int Graph::minNodePRP
private
int Graph::minNodeSBC
private
int Graph::minNodeSCC
private
int Graph::minNodeSDC
private
int Graph::minNodeSPC
private
int Graph::minNodeSSC
private
float Graph::minPP
private
float Graph::minPRP
private
float Graph::minSBC
private
float Graph::minSCC
private
float Graph::minSDC
private
float Graph::minSDP
private
float Graph::minSPC
private
float Graph::minSSC
private
float Graph::nomEC
private
float Graph::nomEVC
private
float Graph::nomIC
private
float Graph::nomIRCC
private
float Graph::nomPP
private
float Graph::nomPRC
private
float Graph::nomSBC
private
float Graph::nomSCC
private
float Graph::nomSPC
private
bool Graph::order
private
int Graph::outboundEdgesVert
private
int Graph::reciprocalEdgesVert
private
int Graph::sizeOfComponent
private
H_Int Graph::sizeOfNthOrderNeighborhood
stack<int> Graph::Stack
private
float Graph::sumBC
private
float Graph::sumCC
private
float Graph::sumDC
private
float Graph::sumDP
private
float Graph::sumEC
private
float Graph::sumEccentricity
private
float Graph::sumEVC
private
float Graph::sumIC
private
float Graph::sumIRCC
private
Matrix Graph::sumM
private
float Graph::sumPC
private
float Graph::sumPP
private
float Graph::sumPRP
private
float Graph::sumSBC
private
float Graph::sumSC
private
float Graph::sumSCC
private
float Graph::sumSDC
private
float Graph::sumSDP
private
float Graph::sumSEVC
private
float Graph::sumSPC
private
float Graph::sumSSC
private
float Graph::t_sumIC
private
float Graph::t_sumPRP
private
int Graph::timerId
private
Matrix Graph::TM
private
QList<int> Graph::triadTypeFreqs
private
float Graph::varianceCLC
private
float Graph::varianceEC
private
float Graph::varianceEVC
private
float Graph::varianceIC
private
float Graph::varianceIRCC
private
float Graph::variancePP
private
float Graph::variancePRP
private
float Graph::varianceSBC
private
float Graph::varianceSCC
private
float Graph::varianceSDC
private
float Graph::varianceSDP
private
float Graph::varianceSPC
private
float Graph::varianceSSC
private
QString Graph::VERSION
private
WebCrawler_Parser* Graph::wc_parser
private
QThread Graph::wc_parserThread
private
WebCrawler_Spider* Graph::wc_spider
private
QThread Graph::wc_spiderThread
private
Matrix Graph::XM
private
Matrix Graph::XRM
private
Matrix Graph::XSM
private

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