Code Documentation 3.3
Social Network Visualizer
Loading...
Searching...
No Matches
Graph Class Reference

The Graph class This is the main class for a Graph, used in conjuction with GraphVertex, Parser and Matrix objects. Graph class methods are the interface to various analysis algorithms GraphVertex 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 Types

enum  ModStatus {
  NewNet = -1 , SavedUnchanged = 0 , MinorOptions = 1 , VertexMetadata = 2 ,
  EdgeMetadata = 3 , VertexPositions = 4 , MajorChanges = 10 , VertexCount = 11 ,
  EdgeCount = 12 , VertexEdgeCount = 13
}
enum  Clustering { Single_Linkage = 0 , Complete_Linkage = 1 , Average_Linkage = 2 }

Public Slots

int relationCurrent ()
 Gets the current relation number.
QString relationCurrentName () const
 Gets the current relation name.
void relationCurrentRename (const QString &newName)
 Overload. Renames current relation to newName, without emitting any signal to MW.
void relationCurrentRename (const QString &newName, const bool &signalMW)
 Renames current relation to newName, optionally emitting a signal to MW.
void vertexCreate (const int &number, 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, const QString &iconPath=QString(), const bool &signalMW=false, const QHash< QString, QString > &customAttributes=QHash< QString, QString >())
 Creates a new vertex.
void graphFileLoaded (const int &fileType, const QString &fName=QString(), const QString &netName=QString(), const int &totalNodes=0, const int &totalLinks=0, const int &edgeDirType=0, const qint64 &elapsedTime=0, const QString &message=QString())
 Stores loaded file name, graph name, sets edge direction type and signals MW to update the UI.
void vertexRemoveDummyNode (int)
 Deletes a dummy node.
void graphLoadedTerminateParserThreads (QString reason)
 Graph::graphLoadedTerminateParserThreads.
void setSelectionChanged (const QList< int > selectedVertices, const QList< SelectedEdge > selectedEdges)
 Sets the user-selected vertices and edges.
void graphClickedEmptySpace (const QPointF &p)
 Resets the clicked edge and node.
bool edgeCreate (const int &v1, const int &v2, const qreal &weight, const QString &color, const int &type=0, const bool &drawArrows=true, const bool &bezier=false, const QString &label=QString(), const bool &signalMW=true)
 Checks if edge (v1,v2) already exists, then creates it and signals the UI to draw it.
void edgeCreateWebCrawler (const int &source, const int &target)
 Called from WebCrawler when it finds an new link Calls edgeCreate() method with initEdgeColor.
void vertexCreateAtPos (const QPointF &p)
 Creates a new vertex in the given position.
void vertexCreateAtPosRandom (const bool &signalMW=false)
 Creates a new randomly positioned vertex with default values.
void vertexCreateAtPosRandomWithLabel (const int &i, const QString &label, const bool &signalMW=false)
 Creates a new randomly positioned vertex with specific number and label. All other values are from the defaults.
void relationSet (int relNum=RAND_MAX, const bool &updateUI=true)
 Changes the current relation, and optionally emits signals to MW/GW (default: true).
void relationNext ()
 Changes graph to next relation.
void relationPrev ()
 Changes graph to previous relation.
void canvasSizeSet (const int &width, const int &height)
 Sets the size of the canvas.
double canvasMaxRadius () const
 Gets the max radius of the canvas.
qreal canvasMinDimension () const
 Gets the min dimensions of the canvas.
double canvasVisibleX (const double &x) const
 Checks if x is visible inside the canvas usable area and if not returns an adjusted x-coordinate.
double canvasVisibleY (const double &y) const
 Checks if y is visible inside the canvas usable area and if not returns an adjusted y-coordinate.
double canvasRandomX () const
 Returns a random x-coordinate adjusted to be visible inside the canvas usable area.
double canvasRandomY () const
 Returns a random y-coordinate adjusted to be visible inside the canvas usable area.
void vertexIsolatedAllToggle (const bool &toggle)
 Toggles the status of all isolated vertices (those without links).
void vertexClickedSet (const int &v, const QPointF &p)
 Sets the clicked vertex.
void edgeClickedSet (const int &v1, const int &v2, const bool &openMenu=false)
 Sets the clicked edge.
void vertexFilterByCentrality (const float threshold, const bool overThreshold, const IndexType centralityIndex)
 Filters vertices by their score on the given centrality or prestige index.
void edgeFilterByWeight (const qreal, const bool)
 Filters (disables) edges according the specified threshold weight.
void edgeFilterByRelation (int relation, bool status)
 Toggles (enables or disables) all edges of the given relation.
void edgeFilterUnilateral (const bool &toggle)
 Enables or disables unilateral edges in current relationship.
void startWebCrawler (const QUrl &startUrl, const QStringList &urlPatternsIncluded, const QStringList &urlPatternsExcluded, const QStringList &linkClasses, const int &maxNodes, const int &maxLinksPerPage, const bool &intLinks, const bool &childLinks, const bool &parentLinks, const bool &selfLinks, const bool &extLinksIncluded, const bool &extLinksCrawl, const bool &socialLinks, const bool &delayedRequests)
 Creates a new WebCrawler, that will parse the downloaded HTML code of each webpage we download. Moves the WebCrawler to a new thread and starts the thread. Then creates the fist node (initial url), and starts the web spider to download the first HTML page. Called by MW with user options.
void slotHandleCrawlerRequestReply ()
 Gets the reply of a MW network request made by Web Crawler, and emits that reply as is to the Web Crawler.
void webSpider ()
 A loop, that takes urls awaiting in front of the urlQueue, and signals to the MW to make the network request.
QString htmlEscaped (QString str) const
 Helper method, returns a nice qstring where all html special chars are encoded.

Signals

void signalWebCrawlParse (QNetworkReply *reply)
void signalNetworkManagerRequest (const QUrl &currentUrl, const NetworkRequestType &type)
void signalProgressBoxCreate (const int max=0, const QString msg="Please wait")
void signalProgressBoxKill (const int max=0)
void signalProgressBoxUpdate (const int &count=0)
void signalGraphSavedStatus (const int &status)
void signalGraphModified (const bool &undirected, const int &vertices, const int &edges, const qreal &density, const bool &notSaved=true)
void signalGraphLoaded (const int &fileType, const QString &fileName=QString(), const QString &netName=QString(), const int &totalNodes=0, const int &totalLinks=0, const qreal &density=0, const qint64 &elapsedTime=0, const QString &message=QString())
void statusMessage (const QString &message)
void signalDatasetDescription (QString)
void signalNodeClickedInfo (const int &number=0, const QPointF &p=QPointF(), const QString &label=QString(), const int &inDegree=0, const int &outDegree=0)
void signalEdgeClicked (const MyEdge &edge=MyEdge(), const bool &openMenu=false)
void signalRelationAddToMW (const QString &newRelation)
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 signalPromininenceDistributionChartUpdate (QAbstractSeries *series, QAbstractAxis *axisX=Q_NULLPTR, const qreal &min=0, const qreal &max=0, QAbstractAxis *axisY=Q_NULLPTR, const qreal &minF=0, const qreal &maxF=0)
void signalDrawNode (const QPointF &p, const int &num, const int &size, const QString &nodeShape, const QString &nodeIconPath, const QString &nodeColor, const QString &numberColor, const int &numSize, const int &numDistance, const QString &label, const QString &labelColor, const int &labelSize, const int &labelDistance)
void signalRemoveNode (int)
void signalDrawEdge (const int &v1, const int &v2, const qreal &weight, const QString &label="", const QString &color="black", const int &type=0, const bool &drawArrows=true, const bool &bezier=false, const bool &weightNumbers=false)
void signalRemoveEdge (const int &v1, const int &v2, const bool &removeReverse)
void signalSetEdgeVisibility (const int &relation, const int &source, const int &target, const bool &toggle, const bool &preserveReverseEdge=false, const int &edgeWeight=1, const int &reverseEdgeWeight=1)
void setVertexVisibility (const int &number, const bool &toggle)
void setNodePos (const int &, const qreal &, const qreal &)
void signalNodesFound (const QList< int > foundList)
void setNodeSize (const int &v, const int &size)
void setNodeShape (const int &v, const QString &shape, const QString &iconPath=QString())
void setNodeColor (const int &v, const QString &color)
void setNodeLabel (const int &v, const QString &label)
void setNodeNumberColor (const int &v, const QString &color)
void setNodeNumberSize (const int &v, const int &size)
void setNodeNumberDistance (const int &v, const int &distance)
void setNodeLabelSize (const int &v, const int &size)
void setNodeLabelColor (const int &v, const QString &color)
void setNodeLabelDistance (const int &v, const int &distance)
void setEdgeWeight (const int &v1, const int &v2, const qreal &weight)
void signalEdgeType (const int &v1, const int &v2, const int &type)
void setEdgeColor (const int &v1, const int &v2, const QString &color)
void setEdgeLabel (const int &v1, const int &v2, const QString &label)
void addGuideCircle (const double &, const double &, const double &)
void addGuideHLine (const double &y0)

Public Member Functions

 Graph (const int &reserveVerticesSize=5000, const int &reserveEdgesPerVertexSize=500)
 Constructs a Graph.
 ~Graph ()
 Destroys the Graph object.
QThread * getThread () const
void moveToThreadFacade (QThread *thread)
void clear (const QString &reason="")
 Clears all vertices.
QString getFileName () const
 Returns the file name of the current graph, if any.
void setFileName (const QString &fileName)
 Sets the file name of the current graph.
QString getName () const
 Returns the name of the current graph.
void setName (const QString &graphName)
 Sets the name of the current graph.
bool isSaved () const
 Returns true if the graph is saved.
bool isLoaded () const
 Returns true if a graph has been loaded from a file.
int getFileFormat () const
 Returns the format of the last file opened.
void setFileFormat (const int &fileFormat)
bool isFileFormatExportSupported (const int &fileFormat) const
 Returns true if the fileFormat is supported for saving.
void setModStatus (const int &graphNewStatus, const bool &signalMW=true)
 Sets the graph modification status.
bool isModified () const
 Returns true of graph is modified (edges/vertices added/removed).
void loadFile (const QString fileName, const QString codecName, const int format, const QString delimiter=QString(), const int sm_two_mode=1, const bool sm_has_labels=false)
 Loads a graph from a given file.
void saveToFile (const QString &fileName, const int &fileType, const bool &saveEdgeWeights=true, const bool &saveZeroWeightEdges=false)
 Saves the current graph to a file.
bool saveToPajekFormat (const QString &fileName, QString networkName="", int maxWidth=0, int maxHeight=0)
 Saves the active graph to a Pajek-formatted file.
bool saveToAdjacencyFormat (const QString &fileName, const bool &saveEdgeWeights=true)
 Saves the active graph to an adjacency-formatted file.
bool saveToGraphMLFormat (const QString &fileName, const bool &saveZeroWeightEdges=false, QString networkName="", int maxWidth=0, int maxHeight=0)
 Saves the current graph to a GraphML-formatted file.
bool saveToDotFormat (QString fileName)
 TODO Saves the active graph to a UCINET-formatted file.
QString graphMatrixTypeToString (const int &matrixType) const
 Helper method, return the human readable name of matrix type.
int graphMatrixStrToType (const QString &matrix) const
 Helper method, return the matrix type of human readable matrix name .
QString graphMetricTypeToString (const int &metricType) const
 Helper method, return the human readable name of metric type.
int graphMetricStrToType (const QString &metricStr) const
 Helper method, return the identifier of a metric.
QString graphClusteringMethodTypeToString (const int &methodType) const
 Helper method, return the human readable name of clustering method type.
int graphClusteringMethodStrToType (const QString &method) const
 Helper method, return clustering method type from the human readable name of it.
int relations ()
 Returns the count of relationships in this Graph.
void relationsClear ()
 Clears relationships in this Graph.
void relationAdd (const QString &relName, const bool &changeRelation=false)
 Adds a new relation to the graph.
int vertexIndexByNumber (int v) const
 Returns the index of a vertex by its number.
GraphVertexvertexAtIndex (int idx)
 Returns the vertex at a given index.
const GraphVertexvertexAtIndex (int idx) const
 Returns the vertex at a given index.
VList::const_iterator verticesBegin () const
 iterator helpers
VList::const_iterator verticesEnd () const
int vertexNumberMax ()
 Returns the number of the last vertex in the graph.
int vertexNumberMin ()
 Returns the number of the first vertex in the graph.
int vertexDegreeOut (int)
 Returns the outDegree (sum of outbound edge weights) of vertex v1.
int vertexDegreeIn (int)
 Returns the inDegree (sum of inbound edge weights) of vertex v1.
QList< int > vertexNeighborhoodList (const int &v1)
 Returns a list of all vertices mutually connected to vertex v1 in the current relation.
QSet< int > vertexNeighborhoodSet (const int &v1)
 Returns the set of all vertices mutually connected to vertex v1 in the current relation.
bool vertexIsolated (const int &v1) const
 Checks if vertex is isolated.
int vertexExists (const int &v1)
 Checks if the given vertex exists in the graph.
int vertexExists (const QString &label)
 Checks if there is a vertex with a specific label exists in the graph.
bool vertexFindByNumber (const QStringList &numList)
 Finds vertices in strList by their number.
bool vertexFindByLabel (const QStringList &labelList)
 Finds vertices by their label.
bool vertexFindByIndexScore (const int &index, const QStringList &thresholds, const bool &considerWeights, const bool &inverseWeights=false, const bool &dropIsolates=false)
 Finds vertices by their index score.
void vertexRemove (const int &v1)
 Removes the vertex v1 from the graph First, it removes all edges to doomed from other vertices Then it changes the vpos of all subsequent vertices inside m_graph Finally, it removes the vertex.
void vertexSizeInit (const int)
 Sets the initial vertex size.
void vertexSizeSet (const int &v, const int &newsize)
 Changes the size of a vertex v or all vertices if v=0.
int vertexSize (const int &v) const
 Returns the size of vertex v.
void vertexShapeSetDefault (const QString, const QString &iconPath=QString())
 Sets the default vertex shape and iconPath.
void vertexShapeSet (const int &v, const QString &shape, const QString &iconPath=QString())
 Changes the shape and iconPath of vertex v1, or all vertices if v1=-1.
QString vertexShape (const int &v)
 Returns the shape of this vertex.
QString vertexShapeIconPath (const int &v)
 Returns the IconPath of vertex v1.
bool graphHasVertexCustomIcons () const
 Returns true if at least one vertex has a 'custom' shape (therefore a custom icon).
QStringList graphHasVertexCustomAttributes () const
 Returns true if at least one vertex has a 'custom' attribute.
void vertexColorInit (const QString &color)
 Graph::vertexColorInit default vertex color initialization.
void vertexColorSet (const int &v, const QString &color)
 Changes the color of vertex v1.
QColor vertexColor (const int &v) const
 Graph::vertexColor.
void vertexNumberColorInit (const QString &color)
 Changes the initial color of the vertex numbers.
void vertexNumberColorSet (const int &v=0, const QString &color="#000000")
 Graph::vertexColorSet Changes the color of vertex v1.
void vertexNumberSizeInit (const int &size)
 Changes the initial size of vertex numbers.
void vertexNumberSizeSet (const int &v, const int &newsize)
 Changes the size of vertex v number.
void vertexNumberDistanceInit (const int &distance)
 Changes the initial distance of vertex numbers.
void vertexNumberDistanceSet (const int &v, const int &newDistance)
 Changes the distance.of vertex v number from the vertex.
void vertexLabelSet (const int &v, const QString &label)
 Changes the label of a vertex v1.
QString vertexLabel (const int &v) const
 Returns the label of a vertex v1.
void vertexLabelsVisibilitySet (bool toggle)
void vertexLabelSizeInit (int newSize)
 Graph::vertexLabelSizeInit Changes the default size of vertex labels.
void vertexLabelSizeSet (const int &v, const int &labelSize)
 Changes the label size of vertex v1 or all vertices if v1=0.
void vertexLabelColorInit (QString color)
 Graph::vertexLabelColorInit Changes the default vertex label color.
void vertexLabelColorSet (const int &v1, const QString &color)
 Changes the label color of vertex v1 or all vertices if v1 = 0.
void vertexLabelDistanceInit (const int &distance)
 Changes the default distance of vertex labels.
void vertexLabelDistanceSet (const int &v, const int &newDistance)
 Changes the distance.of vertex v label from the vertex.
void vertexLabelDistanceAllSet (const int &newDistance)
 Changes the distance of all vertex labels from their vertices.
void vertexCustomAttributesSet (const int &v1, const QHash< QString, QString > &customAttributes)
 Sets custom attributes for a specified vertex.
QHash< QString, QString > vertexCustomAttributes (const int &v1) const
 Calls the customAttributes method for a specific vertex in the graph.
void vertexPosSet (const int &v, const int &x, const int &y)
 Changes the position of the given vertex.
QPointF vertexPos (const int &v1) const
 Returns the position of the given vertex.
int vertexClicked () const
 Returns the number of the clicked vertex.
int vertices (const bool &dropIsolates=false, const bool &countAll=false, const bool &recount=false)
 Gets the number of vertices in the graph.
int vertexEdgesOutbound (int i)
 Returns the number of outbound edges (arcs) from vertex v1.
int vertexEdgesInbound (int i)
 Returns the number of inbound edges (arcs) to vertex v1.
int verticesWithOutboundEdges ()
 Returns the sum of vertices having edgesOutbound.
int verticesWithInboundEdges ()
 Returns the sum of vertices having edgesInbound.
int verticesWithReciprocalEdges ()
 Returns the sum of vertices having reciprocal edges.
QList< int > verticesListIsolated ()
 Returns a list of all isolated vertices inside the graph.
QList< int > verticesList ()
 Returns a list of all vertices numbers inside the graph.
QSet< int > verticesSet ()
 Returns a QSet of all vertices numbers inside the graph.
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_verticesSelected.
GraphVertexvertexPtr (const int v)
int edgesEnabled ()
 Returns the number of enabled ties in the current relation.
MyEdge edgeClicked ()
 Returns clicked edge.
qreal edgeExists (const int &v1, const int &v2, const bool &checkReciprocal=false)
 Checks if there is an edge from v1 to v2 and returns the weight, if the edge exists.
qreal edgeExistsVirtual (const int &v1, const int &v2)
 Checks if there is an edge from v1 to v2, even weight = 0 and returns the weight, if the edge exists or RAND_MAX if the edge does not exist at all.
void edgeOutboundStatusSet (const int &source, const int &target, const bool &toggle=false)
 Toggles the status of outbound edge source -> target at source vertex.
void edgeInboundStatusSet (const int &target, const int &source, const bool &toggle=false)
 Toggles the status of inbound edge target <- source at target vertex.
void edgeRemove (const int &v1, const int &v2, const bool &removeReverse=false)
 Removes the directed arc v1->v2 or, if the graph is undirected, the edge v1 <->v2.
void edgeRemoveSelected (SelectedEdge &selectedEdge, const bool &removeReverse)
 Removes a SelectedEdge.
void edgeRemoveSelectedAll ()
 Removes all selected edges.
bool edgeSymmetric (const int &v1, const int &v2)
 Returns TRUE if edge(v1, v2) is symmetric, i.e. (v1,v2) == (v2,v1).
void edgeTypeSet (const int &v1, const int &v2, const qreal &w, const int &dirType=EdgeType::Directed)
 Changes the direction type of an existing edge.
void edgeWeightSet (const int &v1, const int &v2, const qreal &w, const bool &undirected=false)
 Changes the weight of the edge from vertex v1 to v2 (and optionally of the reverse edge).
qreal edgeWeight (const int &v1, const int &v2) const
 Returns the weight of the edge v1->v2.
void edgeWeightNumbersVisibilitySet (const bool &toggle)
 Changes the visibility of edge weight numbers.
void edgeLabelSet (const int &v1, const int &v2, const QString &label)
 Changes the label of edge v1->v2.
QString edgeLabel (const int &v1, const int &v2) const
 Returns the label of edge v1->v2.
void edgeLabelsVisibilitySet (const bool &toggle)
 Toggles the visibility of edge labels.
void edgeColorInit (const QString &)
 Saves the default edge color Used by random network creation methods.
void edgeColorSet (const int &v1, const int &v2, const QString &color)
 Changes the color of edge v1->v2.
QString edgeColor (const int &v1, const int &v2)
 Returns the color of the directed edge v1->v2.
bool edgeColorAllSet (const QString &color, const int &threshold=RAND_MAX)
 Changes the color of all enabled edges.
bool isEmpty () const
 Returns true if the current graph has no vertices at all.
QList< int > getSelectedVertices () const
 Returns a QList of user-selected vertices.
int getSelectedVerticesCount () const
 Returns count of user-selected vertices.
int getSelectedVerticesMin () const
 Returns min of user-selected vertices.
int getSelectedVerticesMax () const
 Returns max of user-selected vertices.
QList< SelectedEdgegetSelectedEdges () const
 Returns a QList of user-selected edges in pair<int,int>.
int getSelectedEdgesCount () const
 Returns the count of user-selected edges.
int getGeodesicsCount ()
 Returns the number of geodesics (shortest-paths) in the graph.
qreal graphDensity ()
 Gets the graph density (if computed) or computes it again.
bool isWeighted ()
 Returns true if the graph is weighted (valued), i.e. if any e in |E| has value not 0 or 1 Complexity: O(n^2).
void setWeighted (const bool &toggle=true)
 Sets the graph to be weighted ( valued edges ).
qreal graphReciprocity ()
 Gets the arc reciprocity of the graph.
bool isSymmetric ()
 Returns TRUE if the adjacency matrix of the current relation is symmetric.
void setSymmetric ()
 Transforms the graph to symmetric (all edges reciprocal).
void addRelationSymmetricStrongTies (const bool &allRelations=false)
 Creates a new symmetric relation by keeping only strong-ties (mutual links) in the current relation. In the new relation, two actors are connected only if they are mutually connected in the current relation.
void relationAddCocitation ()
 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.
void graphDichotomization (const qreal threshold)
 Creates a new binary relation in a valued network using edge dichotomization according to the threshold parameter.
void setDirected (const bool &toggle=true, const bool &signalMW=true)
 Toggles the graph directed or undirected.
void setUndirected (const bool &toggle=true, const bool &signalMW=true)
 Makes the graph undirected or directed.
bool isDirected ()
 Returns true if graph is directed.
bool isUndirected ()
 Returns true if graph is undirected.
bool isConnected ()
 Checks if the graph is connected, in the sense of a topological space, i.e., there is a path from any vertex to any other vertex in the graph.
bool isConnectedCached () const
 Returns true if the graph is connected, without recalculating it.
void createMatrixAdjacency (const bool dropIsolates=false, const bool considerWeights=true, const bool inverseWeights=false, const bool symmetrize=false)
 Creates an adjacency matrix AM where AM(i,j)=1 if i is connected to j and AM(i,j)=0 if i not connected to j Used in Graph::centralityInformation(), Graph::graphWalksMatrixCreate and Graph::createMatrixAdjacencyInverse().
bool createMatrixAdjacencyInverse (const QString &method="lu")
 Computes the inverse of the current adjacency matrix.
void createMatrixSimilarityMatching (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.
void createMatrixSimilarityPearson (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.
void createMatrixDissimilarities (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.
void setReportsDataDir (const QString &reportsDir)
 Sets the directory where reports are saved This is used when exporting prominence distribution images to be used in HTML reports.
void setReportsRealNumberPrecision (const int &precision)
 Sets the precision (number of fraction digits) the app will use when writing real numbers in reports.
void setReportsLabelLength (const int &length)
 Sets the length of labels in reports.
void setReportsChartType (const int &type)
 Sets the chart type in reports.
void writeDataSetToFile (const QString dir, const QString)
 Writes a "famous" dataset to the given file Datasets are hardcoded! They are exported in the given fileName...
void writeMatrixAdjacencyTo (QTextStream &os, const bool &saveEdgeWeights=true)
void writeReciprocity (const QString fileName, const bool considerWeights=false)
 Writes reciprocity report to filename.
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 writeMatrixHTMLTable (QTextStream &outText, Matrix &M, const bool &markDiag=true, const bool &plain=false, const bool &printInfinity=true, const bool &dropIsolates=false)
 Writes the matrix M as HTML.
void writeMatrixAdjacency (const QString fileName, const bool &markDiag=true)
void writeMatrixAdjacencyPlot (const QString fileName, const bool &simpler=false)
 Writes a visual representation of the adjacency matrix of the graph to the specified file.
void writeMatrixAdjacencyInvert (const QString &filename, const QString &method)
 Calls Graph::createMatrixAdjacencyInverse(method) to compute the inverse of the adjacency matrix and writes it to file fn in HTML notation.
void writeMatrixLaplacianPlainText (const QString &filename)
 Computes the Laplacian matrix of the graph and writes it to given file.
void writeMatrixDegreeText (const QString &filename)
 Computes the Degree matrix of the graph and writes it to given file.
void writeMatrixDistancesPlainText (const QString &fn, const bool &considerWeights, const bool &inverseWeights, const bool &dropIsolates)
 Writes the matrix of distances to a file.
void writeMatrixShortestPathsPlainText (const QString &fn, const bool &considerWeights, const bool &inverseWeights)
 Writes the shortest paths matrix to a file Each SIGMA(i,j) element is the number of shortest paths (geodesics) from i and j.
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.
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.
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.
void writeMatrixSimilarityPearson (const QString fileName, const bool considerWeights, const QString &matrix="adjacency", const QString &varLocation="rows", const bool &diagonal=false)
 Calls Graph::createMatrixSimilarityPearson() and writes Pearson Correlation Coefficients to given file.
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.
void writeEccentricity (const QString fileName, const bool considerWeights=false, const bool inverseWeights=false, const bool dropIsolates=false)
 Writes the Eccentricity report to file.
void writeCentralityDegree (const QString, const bool weights, const bool dropIsolates)
 Writes the Degree Centrality to a file.
void writeCentralityCloseness (const QString, const bool weights, const bool inverseWeights, const bool dropIsolates)
 Writes the closeness centralities to a file.
void writeCentralityClosenessInfluenceRange (const QString, const bool weights, const bool inverseWeights, const bool dropIsolates)
 Writes the "improved" closeness centrality indices to a file.
void writeCentralityBetweenness (const QString, const bool weights, const bool inverseWeights, const bool dropIsolates)
 Writes Betweenness centralities to file.
void writeCentralityPower (const QString, const bool weigths, const bool inverseWeights, const bool dropIsolates)
 Writes Power Centralities to a file.
void writeCentralityStress (const QString, const bool weigths, const bool inverseWeights, const bool dropIsolates)
 Writes the Stress centralities to a file.
void writeCentralityEccentricity (const QString, const bool weigths, const bool inverseWeights, const bool dropIsolates)
 Writes the Eccentricity centralities (aka Harary Graph Centrality) to a file.
void writeCentralityInformation (const QString, const bool weigths, const bool inverseWeights)
 Writes the information centralities to file.
void writeCentralityEigenvector (const QString, const bool &weigths=true, const bool &inverseWeights=false, const bool &dropIsolates=false)
 Writes the eigenvector centralities to a file.
void writePrestigeDegree (const QString, const bool weights, const bool dropIsolates)
 Writes the Degree Prestige of each node to a file.
void writePrestigeProximity (const QString, const bool weights, const bool inverseWeights, const bool dropIsolates)
 Writes the proximity prestige indices to a file.
void writePrestigePageRank (const QString, const bool Isolates=false)
 Writes the PageRank scores of vertices to a file.
bool writeClusteringHierarchical (const QString &fileName, const QString &varLocation, const QString &matrix="Adjacency", 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.
void writeClusteringHierarchicalResultsToStream (QTextStream &outText, const int N, const bool &dendrogram=false)
 Writes Hierarchical Clustering results to given output stream Before running this method, the method Graph::graphClusteringHierarchical() must execute and return true. Otherwise, the result is unpredictable...
bool writeCliqueCensus (const QString &fileName, const bool considerWeights)
 Graph::writeCliqueCensus Calls graphCliques() to compute all cliques (maximal connected subgraphs) of the network. Then writes the results into a file, along with the Actor by clique analysis, the Co-membership matrix and the Hierarchical clustering of overlap matrix.
void writeClusteringCoefficient (const QString, const bool)
 Graph::writeClusteringCoefficient Writes the clustering coefficients to a file.
void writeTriadCensus (const QString, const bool)
int graphConnectednessFull (const bool updateProgress=false)
bool graphReachable (const int &v1, const int &v2)
 Returns true if vertices v1 and v2 are reachable.
void createMatrixReachability ()
 Creates the reachability matrix XRM.
int graphDiameter (const bool considerWeights, const bool inverseWeights)
 Returns the diameter of the graph, aka the largest geodesic distance between any two vertices.
int graphDiameterCached () const
 Returns the number of geodesics (shortest paths) in the graph, without recalculating it.
qreal graphSumDistanceCached () const
 Returns the sum of all finite geodesic distances accumulated by DistanceEngine, without recalculating anything.
qreal graphGeodesicsCountCached () const
 Returns the number of geodesics (shortest paths) accumulated by DistanceEngine, without recalculating anything.
int graphDistanceGeodesic (const int &v1, const int &v2, const bool &considerWeights=false, const bool &inverseWeights=true)
 Returns the geodesic distance (length of shortest path) from vertex v1 to vertex v2.
qreal graphDistanceGeodesicAverage (const bool considerWeights, const bool inverseWeights, const bool dropIsolates)
 Returns the average distance of the graph.
qreal graphDistanceGeodesicAverageCached () const
 Returns the average geodesic distance of the graph, without recalculating it.
void graphDistancesGeodesic (const bool &computeCentralities=false, const bool &considerWeights=false, const bool &inverseWeights=true, const bool &dropIsolates=false)
 Computes the geodesic distances between all vertices: In the process, it also computes many other centrality/prestige metrics:
void ssspStackClear ()
bool ssspStackEmpty () const
int ssspStackTop () const
void ssspStackPop ()
int ssspStackSize () const
void ssspStackPush (int v)
void ssspNthOrderClear ()
H_f_i::const_iterator ssspNthOrderBegin () const
H_f_i::const_iterator ssspNthOrderEnd () const
int ssspNthOrderValue (qreal dist) const
void ssspNthOrderIncrement (int dist)
void ssspNthOrderIncrement (qreal dist)
void ssspComponentReset (int value=1)
void ssspComponentAdd (int delta)
int ssspComponentSize () const
void notConnectedPairsClear ()
void notConnectedPairsInsert (int from, int to)
int notConnectedPairsSize () const
void resetDistanceCentralityCacheFlags ()
void setSymmetricCached (bool v)
bool symmetricCached () const
void setConnectedCached (bool v)
void setDiameterCached (int v)
void resetDistanceAggregates ()
void addToDistanceSum (qreal delta)
void incGeodesicsCount ()
void setAverageDistanceCached (qreal v)
void graphMatrixDistanceGeodesicCreate (const bool &considerWeights=false, const bool &inverseWeights=true, const bool &dropIsolates=false)
 Creates the matrix DM of geodesic distances between vertices.
void graphMatrixShortestPathsCreate (const bool &considerWeights=false, const bool &inverseWeights=true, const bool &dropIsolates=false)
 Creates the matrix SIGMA of shortest paths (geodesics) between vertices Each SIGMA(i,j) is the number of shortest paths (geodesics) from i and j.
int getProminenceIndexByName (const QString &prominenceIndexName)
 Returns the IndexType of the given prominence index name Called from MW::slotEditNodeFind, MW::slotLayoutRadialByProminenceIndex etc.
void prominenceDistribution (const int &index, const ChartType &type, const QString &distImageFileName=QString())
 Computes the distribution of a centrality index score. The distribution is stored as Qt Series depending on the SeriesType parameter type It is send to MW through signal/slot.
void prominenceDistributionBars (const H_StrToInt &discreteClasses, const QString &name, const QString &distImageFileName)
 Computes the prominence distribution and delegates Bar chart rendering.
void prominenceDistributionArea (const H_StrToInt &discreteClasses, const QString &name, const QString &distImageFileName)
 Computes prominence distribution data and delegates Area chart rendering.
void prominenceDistributionSpline (const H_StrToInt &discreteClasses, const QString &seriesName, const QString &distImageFileName)
 Computes prominence distribution data and delegates Spline chart rendering.
void centralityDegree (const bool &considerWeights=true, const bool &dropIsolates=false)
 Calculates the degree (outDegree) centrality of each vertex - diagonal included.
void centralityInformation (const bool considerWeights=false, const bool inverseWeights=false)
 Computes 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.
void centralityEigenvector (const bool &considerWeights=false, const bool &inverseWeights=false, const bool &dropIsolates=false)
 Computes Eigenvector centrality.
void centralityClosenessIR (const bool considerWeights=false, const bool inverseWeights=false, const bool dropIsolates=false)
 Computes an "improved" closeness centrality index, IRCC, which can be used on disconnected graphs. IRCC is an 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.
void prestigeDegree (const bool &considerWeights, const bool &dropIsolates=false)
 Computes the Degree Prestige (in-degree) of each vertex - diagonal included Also the mean value and the variance of the in-degrees.
void prestigePageRank (const bool &dropIsolates=false)
 Calculates the PageRank Prestige of each vertex.
void prestigeProximity (const bool considerWeights=false, const bool inverseWeights=false, const bool dropIsolates=false)
 Computes Proximity Prestige of each vertex Also the mean value and the variance of it..
bool isCentralityIndexComputed (const IndexType index) const
 Returns true if the given centrality/prestige index has been computed.
int walksBetween (int v1, int v2, int length)
 Calculates and returns the number of walks of a given length between v1 and v2.
void graphWalksMatrixCreate (const int &N=0, const int &length=0, const bool &updateProgress=false, const bool &dropIsolates=false, const bool &considerWeights=false, const bool &inverseWeights=false, const bool &symmetrize=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.
void writeWalksTotalMatrixPlainText (const QString &fn)
 Graph::writeWalksTotalMatrixPlainText Writes the total number of walks matrix.
void writeWalksOfLengthMatrixPlainText (const QString &fn, const int &length)
 Graph::writeWalksOfLengthMatrixPlainText.
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.
QList< int > vertexinfluenceRange (int v1)
 Returns the influence range of vertex v1, namely the set of nodes who are reachable from v1 (See Wasserman and Faust, pp.200-201, based on Lin, 1976). The Influence Range of vertex v can also be defined as: Ji = Sum [ D(v,j), iff D(v,j) != inf ] for every j in V, where j!=v and D the distance matrix This function is for digraphs only.
QList< int > vertexinfluenceDomain (int v2)
 Returns the influence domain of vertex v1, namely the set of nodes who can reach v1 The Influence Domain Ii of vertex v can also be defined as: Ii = Sum [ D(i,v), iff D(i,v) != inf ] for every in V, where i!=v and D the distance matrix This function applies to digraphs only.
void writeReachabilityMatrixPlainText (const QString &fn, const bool &dropIsolates=false)
qreal 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 NBS(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.
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 co-membership matrix CLQM .
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.
bool graphClusteringHierarchical (Matrix &STR_EQUIV, const QString &varLocation, 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:
qreal clusteringCoefficientLocal (const int &v1)
 Returns the local clustering coefficient (CLUCOF) of a vertex v1.
qreal clusteringCoefficient (const bool updateProgress=false)
 Computes local clustering coefficients and returns the network average Clustering Coefficient.
bool graphTriadCensus ()
 Graph::graphTriadCensus Conducts a triad census and updates QList::triadTypeFreqs, which is the list carrying all triad type frequencies Complexity:O(n!).
void triadType_examine_MAN_label (int, int, int, GraphVertex *, GraphVertex *, GraphVertex *)
void layoutRandom ()
 Repositions all nodes on random positions Emits setNodePos(i, x,y) to tell GW that the node item should be moved.
void layoutRadialRandom (const bool &guides=true)
 Repositions all nodes on the periphery of different circles with random radius.
void layoutCircular (const double &x0, const double &y0, const double &newRadius, const bool &guides=false)
 Repositions all nodes on the periphery of a circle with given radius.
void layoutByProminenceIndex (int prominenceIndex, int layoutType, const bool &considerWeights=false, const bool &inverseWeights=false, const bool &dropIsolates=false)
 Applies a layout according to each actor's prominence index score. The layout type can be radial (0), level (1), node sizes (2) or node colors (3), as follows: layoutType=0 - Repositions all nodes on the periphery of concentric circles with radius analogous to their prominence index layoutType=1 - Repositions all nodes on different top-down levels according to their centrality layoutType=2 - Changes node sizes to be proportional to their prominence index score layoutType=2 - Changes node colors to reflect their prominence index score (from red to green).
void layoutVertexSizeByIndegree ()
 Convenience method Changes the size of all nodes to be proportional to their InDegree (Degree Prestige) Calls layoutByProminenceIndex.
void layoutVertexSizeByOutdegree ()
 Convenience method Changes the size of all nodes to be proportional to their outDegree (Degree Centrality) Calls layoutByProminenceIndex.
void layoutForceDirectedSpringEmbedder (const int maxIterations)
 Embeds a Force Directed Placement layout according to the initial Spring Embedder model proposed by Eades.
void layoutForceDirectedFruchtermanReingold (const int maxIterations)
 Embeds a Force Directed Placement layout according to the Fruchterman-Reingold model. Fruchterman 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 layoutForceDirectedKamadaKawai (const int maxIterations=500, const bool considerWeights=false, const bool inverseWeights=false, const bool dropIsolates=false, const QString &initialPositions="current")
 Embeds a Force Directed Placement layout according to the Kamada-Kawai model. In this model, the network is considered to be a dynamic system where every two actors are 'particles' mutually 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 particles Initially, the particles/actors are placed on the vertices of a regular n-polygon.
qreal graphDistanceEuclidean (const QPointF &a, const QPointF &b)
 Computes the euclideian distance between QPointF a and b.
qreal graphDistanceEuclidean (const QPointF &a)
 the euclideian distance of QPointF a (where a is difference vector)
int sign (const qreal &D)
 Graph::sign returns the sign of number D as integer (1 or -1).
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.
qreal layoutForceDirected_FR_temperature (const int iteration) const
 Reduces the temperature as the layout approaches a better configuration.
qreal computeOptimalDistance (const int &V)
 Computes Optimal Distance. Used in Spring Embedder and FR algorithms.
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.
void webCrawlTerminateThreads (QString reason)
 called from Graph, when closing network, to terminate all crawler processes Also called indirectly when wc_spider finishes
void randomizeThings ()
 Adds a little universal randomness :).
void randomNetErdosCreate (const int &N, const QString &model, const int &m, const qreal &p, const QString &mode, const bool &diag)
 Creates an erdos-renyi random network according to the given model.
void randomNetScaleFreeCreate (const int &N, const int &power, const int &m0, const int &m, const qreal &alpha, const QString &mode)
 Creates a scale-free random-network network.
void randomNetSmallWorldCreate (const int &N, const int &degree, const double &beta, const QString &mode)
 Creates a small world random network.
void randomNetRingLatticeCreate (const int &N, const int &degree, const bool updateProgress=false)
 Creates a random ring lattice network.
void randomNetRegularCreate (const int &N, const int &degree, const QString &mode, const bool &diag)
 Creates a random network where nodes have the same degree.
void randomNetLatticeCreate (const int &N, const int &length, const int &dimension, const int &neighborhoodLength, const QString &mode, const bool &circular=false)
 Creates a lattice network.
int factorial (int)

Public Attributes

H_f_i sizeOfNthOrderNeighborhood
H_Int vpos

Protected Member Functions

void progressStatus (const QString &msg)
 Emits a status message to be shown in the UI status bar.
void progressCreate (int max, const QString &msg)
 Emits a signal to create a progress box in the UI with the given maximum value and message.
void progressUpdate (int value)
 Emits a signal to update the progress box in the UI with the given value.
void progressFinish ()
 Emits a signal to kill the progress box in the UI, indicating that the operation is complete.
void uiProminenceDistributionSpline (const QVector< QPair< qreal, qreal > > &points, qreal min, qreal max, qreal minF, qreal maxF, const QString &seriesName, const QString &distImageFileName)
void uiProminenceDistributionArea (const QVector< QPair< qreal, qreal > > &points, const qreal min, const qreal max, const qreal minF, const qreal maxF, const QString &name, const QString &distImageFileName)
void uiProminenceDistributionBars (const QStringList &categories, const QVector< qreal > &frequencies, const qreal min, const qreal max, const qreal minF, const qreal maxF, const QString &name, const QString &distImageFileName)

Private Member Functions

void edgeAdd (const int &v1, const int &v2, const qreal &weight, const int &type, const QString &label, const QString &color)
 Adds a directed arc from v1 to v2 into the internal graph data structures.
void dijkstra (const int &s, const int &si, const bool &computeCentralities=false, const bool &inverseWeights=false, const bool &dropIsolates=false)
void minmax (qreal C, GraphVertex *v, qreal &max, qreal &min, int &maxNode, int &minNode)
 Computes minimum and maximum centralities during graphDistancesGeodesic().
void resolveClasses (qreal C, H_StrToInt &discreteClasses, int &classes)
 Checks if score C is a new prominence class If yes, it stores that number in a QHash<QString,int> type where the score is the key. If no, increases the frequency of this prominence score by 1 Called from graphDistancesGeodesic().
void resolveClasses (qreal C, H_StrToInt &discreteClasses, int &classes, int name)
 Overloaded method. It only adds displaying current vertex for debugging purposes.

Private Attributes

QThread file_parserThread
QThread webcrawlerThread
VList m_graph
Parserfile_parser
WebCrawlerweb_crawler
QQueue< QUrl > * urlQueue
int m_crawler_max_urls
int m_crawler_visited_urls
QList< QString > m_relationsList
QList< int > m_graphFileFormatExportSupported
QList< int > triadTypeFreqs
QList< int > m_verticesList
QList< int > m_verticesIsolatedList
QList< int > m_verticesSelected
QSet< int > m_verticesSet
QList< SelectedEdgem_selectedEdges
QMultiHash< int, int > influenceRanges
QMultiHash< int, int > influenceDomains
QMultiHash< int, int > m_vertexPairsNotConnected
QHash< int, int > m_vertexPairsUnilaterallyConnected
QMultiMap< int, L_intm_cliques
QHash< int, QSet< int > > neighboursHash
QList< qreal > m_clusteringLevel
QMap< int, V_intm_clustersPerSequence
QMap< QString, V_intm_clustersByName
QMap< int, V_strm_clusterPairNamesPerSeq
Matrix SIGMA
Matrix DM
Matrix sumM
Matrix invAM
Matrix AM
Matrix invM
Matrix WM
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
QString m_reportsDataDir
int m_reportsRealPrecision
int m_reportsLabelLength
ChartType m_reportsChartType
int m_fieldWidth
int m_curRelation
int m_fileFormat
int m_vertexClicked
MyEdge m_clickedEdge
qreal edgeWeightTemp
qreal edgeReverseWeightTemp
qreal meanSDC
qreal varianceSDC
qreal meanSCC
qreal varianceSCC
qreal meanIRCC
qreal varianceIRCC
qreal meanSBC
qreal varianceSBC
qreal meanSSC
qreal varianceSSC
qreal meanEC
qreal varianceEC
qreal meanSPC
qreal varianceSPC
qreal meanIC
qreal varianceIC
qreal meanEVC
qreal varianceEVC
qreal meanSDP
qreal varianceSDP
qreal meanPP
qreal variancePP
qreal meanPRP
qreal variancePRP
qreal minEccentricity
qreal maxEccentricity
qreal minSDP
qreal maxSDP
qreal sumDP
qreal sumSDP
qreal groupDP
qreal minSDC
qreal maxSDC
qreal sumDC
qreal sumSDC
qreal groupDC
qreal minSCC
qreal maxSCC
qreal nomSCC
qreal denomSCC
qreal sumCC
qreal sumSCC
qreal groupCC
qreal maxIndexCC
qreal minIRCC
qreal maxIRCC
qreal nomIRCC
qreal denomIRCC
qreal sumIRCC
qreal groupIRCC
qreal minSBC
qreal maxSBC
qreal nomSBC
qreal denomSBC
qreal sumBC
qreal sumSBC
qreal groupSBC
qreal maxIndexBC
qreal minSPC
qreal maxSPC
qreal nomSPC
qreal denomSPC
qreal t_sumIC
qreal sumSPC
qreal groupSPC
qreal maxIndexPC
qreal minSSC
qreal maxSSC
qreal sumSC
qreal sumSSC
qreal groupSC
qreal maxIndexSC
qreal minEC
qreal maxEC
qreal nomEC
qreal denomEC
qreal sumEC
qreal groupEC
qreal maxIndexEC
qreal minIC
qreal maxIC
qreal nomIC
qreal denomIC
qreal sumIC
qreal maxIndexIC
qreal minEVC
qreal maxEVC
qreal nomEVC
qreal denomEVC
qreal sumEVC
qreal sumSEVC
qreal groupEVC
qreal minPRP
qreal maxPRP
qreal nomPRC
qreal denomPRC
qreal sumPC
qreal t_sumPRP
qreal sumPRP
qreal minPP
qreal maxPP
qreal nomPP
qreal denomPP
qreal sumPP
qreal groupPP
qreal minCLC
qreal maxCLC
qreal averageCLC
qreal varianceCLC
qreal 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
qreal sizeOfComponent
int m_graphModStatus
int m_reserveEdgesPerVertexSize
int m_totalVertices
int m_totalEdges
int m_graphDiameter
int initVertexSize
int initVertexLabelSize
int initVertexNumberSize
int initVertexNumberDistance
int initVertexLabelDistance
bool order
bool initEdgeWeightNumbers
bool initEdgeLabels
qreal m_graphAverageDistance
qreal m_graphGeodesicsCount
qreal m_graphDensity
qreal m_graphSumDistance
qreal m_graphReciprocityArc
qreal m_graphReciprocityDyad
int m_graphReciprocityTiesReciprocated
int m_graphReciprocityTiesNonSymmetric
int m_graphReciprocityTiesTotal
int m_graphReciprocityPairsReciprocated
int m_graphReciprocityPairsTotal
bool m_graphHasVertexCustomIcons
int outboundEdgesVert
int inboundEdgesVert
int reciprocalEdgesVert
qreal canvasWidth
qreal 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 calculatedGraphReciprocity
bool calculatedGraphDensity
bool calculatedGraphWeighted
bool m_graphIsDirected
bool m_graphIsSymmetric
bool m_graphIsWeighted
bool m_graphIsConnected
int csRecDepth
QString m_fileName
QString m_graphName
QString initEdgeColor
QString initVertexColor
QString initVertexNumberColor
QString initVertexLabelColor
QString initVertexShape
QString initVertexIconPath
QString htmlHead
QString htmlHeadLight
QString htmlEnd
QDateTime actualDateTime

Friends

class DistanceEngine

Detailed Description

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

Member Enumeration Documentation

◆ Clustering

Enumerator
Single_Linkage 
Complete_Linkage 
Average_Linkage 

◆ ModStatus

Enumerator
NewNet 
SavedUnchanged 
MinorOptions 
VertexMetadata 
EdgeMetadata 
VertexPositions 
MajorChanges 
VertexCount 
EdgeCount 
VertexEdgeCount 

Constructor & Destructor Documentation

◆ Graph()

Graph::Graph ( const int & reserveVerticesSize = 5000,
const int & reserveEdgesPerVertexSize = 500 )

Constructs a Graph.

◆ ~Graph()

Graph::~Graph ( )

Destroys the Graph object.

Member Function Documentation

◆ addGuideCircle

void Graph::addGuideCircle ( const double & ,
const double & ,
const double &  )
signal

◆ addGuideHLine

void Graph::addGuideHLine ( const double & y0)
signal

◆ addRelationSymmetricStrongTies()

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

Creates a new symmetric relation by keeping only strong-ties (mutual links) in the current relation. In the new relation, two actors are connected only if they are mutually connected in the current relation.

Parameters
allRelations

◆ addToDistanceSum()

void Graph::addToDistanceSum ( qreal delta)

◆ canvasMaxRadius

double Graph::canvasMaxRadius ( ) const
slot

Gets the max radius of the canvas.

Returns
double

◆ canvasMinDimension

qreal Graph::canvasMinDimension ( ) const
slot

Gets the min dimensions of the canvas.

Returns
qreal

◆ canvasRandomX

double Graph::canvasRandomX ( ) const
slot

Returns a random x-coordinate adjusted to be visible inside the canvas usable area.

Returns
double

◆ canvasRandomY

double Graph::canvasRandomY ( ) const
slot

Returns a random y-coordinate adjusted to be visible inside the canvas usable area.

Returns
double

◆ canvasSizeSet

void Graph::canvasSizeSet ( const int & width,
const int & height )
slot

Sets the size of the canvas.

Called when the MW is resized to update canvasWidth/canvasHeight, and node positions

Parameters
w
h

◆ canvasVisibleX

double Graph::canvasVisibleX ( const double & x) const
slot

Checks if x is visible inside the canvas usable area and if not returns an adjusted x-coordinate.

Parameters
x
Returns
double

◆ canvasVisibleY

double Graph::canvasVisibleY ( const double & y) const
slot

Checks if y is visible inside the canvas usable area and if not returns an adjusted y-coordinate.

Parameters
y
Returns
double

◆ centralityClosenessIR()

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

Computes an "improved" closeness centrality index, IRCC, which can be used on disconnected graphs. IRCC is an 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

◆ centralityDegree()

void Graph::centralityDegree ( const bool & considerWeights = true,
const bool & dropIsolates = false )

Calculates the degree (outDegree) centrality of each vertex - diagonal included.

Parameters
considerWeights
dropIsolates

◆ centralityEigenvector()

void Graph::centralityEigenvector ( const bool & considerWeights = false,
const bool & inverseWeights = false,
const bool & dropIsolates = false )

Computes Eigenvector centrality.

Parameters
considerWeights
inverseWeights

◆ centralityInformation()

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

Computes 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

◆ clear()

void Graph::clear ( const QString & reason = "")

Clears all vertices.

Parameters
reason

◆ clusteringCoefficient()

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

Computes local clustering coefficients and returns the network average Clustering Coefficient.

Parameters
updateProgress
Returns

◆ clusteringCoefficientLocal()

qreal Graph::clusteringCoefficientLocal ( const int & v1)

Returns the local clustering coefficient (CLUCOF) of a vertex v1.

Parameters
v1
Returns

◆ compute_angles()

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

◆ computeOptimalDistance()

qreal Graph::computeOptimalDistance ( const int & V)

Computes Optimal Distance. Used in Spring Embedder and FR algorithms.

Returns
qreal optimalDistance

◆ createMatrixAdjacency()

void Graph::createMatrixAdjacency ( const bool dropIsolates = false,
const bool considerWeights = true,
const bool inverseWeights = false,
const bool symmetrize = false )

Creates an adjacency matrix AM where AM(i,j)=1 if i is connected to j and AM(i,j)=0 if i not connected to j Used in Graph::centralityInformation(), Graph::graphWalksMatrixCreate and Graph::createMatrixAdjacencyInverse().

Parameters
dropIsolates
considerWeights
inverseWeights
symmetrize

◆ createMatrixAdjacencyInverse()

bool Graph::createMatrixAdjacencyInverse ( const QString & method = "lu")

Computes the inverse of the current adjacency matrix.

Parameters
method
Returns

◆ createMatrixDissimilarities()

void Graph::createMatrixDissimilarities ( 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
INPUT_MATRIX
DSM
metric
varLocation
diagonal
considerWeights

◆ createMatrixReachability()

void Graph::createMatrixReachability ( )

Creates the reachability matrix XRM.

◆ createMatrixSimilarityMatching()

void Graph::createMatrixSimilarityMatching ( 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

◆ createMatrixSimilarityPearson()

void Graph::createMatrixSimilarityPearson ( 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 =\frac{\sum ^n _{i=1}(x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\sum ^n _{i=1}(x_i - \bar{x})^2} \sqrt{\sum ^n _{i=1}(y_i - \bar{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

◆ dijkstra()

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

methods used by graphDistancesGeodesic()

◆ edgeAdd()

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

Adds a directed arc from v1 to v2 into the internal graph data structures.

private member functions

This is the low-level storage function. It does NOT signal the UI. All UI signaling is handled by the caller (edgeCreate / signalDrawEdge).

Internally, each vertex maintains two adjacency lists:

  • OutEdges: arcs going OUT from this vertex
  • InEdges: arcs coming IN to this vertex

For a directed arc v1->v2:

  • v1's OutEdges gains v2 (with weight, color, label)
  • v2's InEdges gains v1 (with weight)

For an undirected edge (EdgeType::Undirected), the edge is stored as two symmetric directed arcs:

  • v1->v2 (OutEdge of v1, InEdge of v2)
  • v2->v1 (OutEdge of v2, InEdge of v1) This matches SocNetV's internal convention: undirected edges are always represented as a pair of reciprocal directed arcs in the adjacency structure.

For EdgeType::Reciprocated, the reverse arc v2->v1 already exists in the data model (created earlier as a directed arc). No additional storage is needed here; the caller is responsible for updating type semantics if required.

Weight handling: If weight != 1 and weight != 0, the graph is marked as weighted. Weight == 0 is treated as a special "null" edge (drawn in blue by convention).

Parameters
v1Source node number (external node number, not internal index)
v2Target node number (external node number, not internal index)
weightEdge weight
typeEdgeType::Directed, Undirected, or Reciprocated
labelEdge label (optional, stored on the out-arc of v1)
colorEdge color (optional, stored on the out-arc of v1)

◆ edgeClicked()

MyEdge Graph::edgeClicked ( )

Returns clicked edge.

Returns

◆ edgeClickedSet

void Graph::edgeClickedSet ( const int & v1,
const int & v2,
const bool & openMenu = false )
slot

Sets the clicked edge.

Parameters are the source and target node of the edge. It emits signal to MW, which displays a relevant message on the status bar.

Parameters
v1
v2

◆ edgeColor()

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

Returns the color of the directed edge v1->v2.

Parameters
v1
v2
Returns

◆ edgeColorAllSet()

bool Graph::edgeColorAllSet ( const QString & color,
const int & threshold = RAND_MAX )

Changes the color of all enabled edges.

Parameters
color
Returns

◆ edgeColorInit()

void Graph::edgeColorInit ( const QString & color)

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

Parameters
color

◆ edgeColorSet()

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

Changes the color of edge v1->v2.

Parameters
v1
v2
color

◆ edgeCreate

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

Checks if edge (v1,v2) already exists, then creates it and signals the UI to draw it.

Slots to signals from GraphicsWidget and Parser

This is the main entry point for edge creation, called from:

Edge type semantics:

  • EdgeType::Undirected : stores both v1->v2 and v2->v1 internally (via edgeAdd), draws a single undirected edge in the UI.
  • EdgeType::Directed : stores only v1->v2. If v2->v1 already exists, upgrades both to EdgeType::Reciprocated.
  • EdgeType::Reciprocated: both directions exist with equal weight.

Mixed-section Pajek files (*Arcs followed by *Edges): Some Pajek files declare directed arcs in an *Arcs section AND undirected edges in a subsequent *Edges section. The same node pair (v1,v2) may appear in both. When *Arcs are processed first, v1->v2 is stored as a directed arc. When *Edges is processed later, edgeExists(v1,v2) returns non-zero, so we must NOT silently drop the request. If v2->v1 is still missing, we store the reverse arc and upgrade the existing forward arc visual to Reciprocated.

In that special case:

  • We store the reverse arc v2->v1 using the undirected edge's weight/color/label. The forward arc (from *Arcs) is left untouched to preserve its original data.
  • We emit signalDrawEdge(v2, v1, ..., Reciprocated) — note the swapped arguments. GraphicsWidget::drawEdge() with Reciprocated looks up the existing arc via createEdgeName(targetNum, sourceNum). Since createEdgeName() is order-sensitive ("rel:v1>v2"), passing (v2,v1) makes targetNum=v1, sourceNum=v2, so the lookup resolves to createEdgeName(v1,v2) which matches the key stored during *Arcs processing. No new GraphicsEdge is created; setDirectionType() is called instead.
  • drawArrows is forced true: a reciprocated edge always shows arrows on both ends regardless of what the undirected request's drawArrows value was.
  • We do NOT set m_graphIsDirected: adding the missing reverse makes the pair more symmetric, not less. Directedness is determined by the overall graph state after full import completes.
  • We return true because a new arc was genuinely added to the graph.
Parameters
v1Source node number
v2Target node number
weightEdge weight
colorEdge color
typeEdge type: EdgeType::Undirected, Directed, or Reciprocated
drawArrowsWhether to draw arrowheads in the UI
bezierWhether to draw the edge as a bezier curve
labelEdge label (optional)
signalMWWhether to signal MainWindow after modifying graph state
Returns
true if a new edge (or reverse arc) was created, false if fully skipped

◆ edgeCreateWebCrawler

void Graph::edgeCreateWebCrawler ( const int & source,
const int & target )
slot

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

Parameters
source
target

◆ edgeExists()

qreal Graph::edgeExists ( const int & v1,
const int & v2,
const bool & checkReciprocal = false )

Checks if there is an edge from v1 to v2 and returns the weight, if the edge exists.

Complexity: O(logN) for vpos retrieval + O(1) for QList index retrieval + O(logN) for checking edge(v2)

Parameters
v1
v2
reciprocatedif true, checks if the edge is reciprocated (v1<->v2) with the same weight
Returns
zero if edge or reciprocated edge does not exist or non-zero if arc /reciprocated edge exists

◆ edgeExistsVirtual()

qreal Graph::edgeExistsVirtual ( const int & v1,
const int & v2 )

Checks if there is an edge from v1 to v2, even weight = 0 and returns the weight, if the edge exists or RAND_MAX if the edge does not exist at all.

This is only used in GraphML saving if the user has selected the Settings option to save zero-weight edges

See also
https://github.com/socnetv/app/issues/151
Parameters
v1
v2

◆ edgeFilterByRelation

void Graph::edgeFilterByRelation ( int relation,
bool status )
slot

Toggles (enables or disables) all edges of the given relation.

Calls the homonymous method of GraphVertex class.

Parameters
relation
status

◆ edgeFilterByWeight

void Graph::edgeFilterByWeight ( const qreal m_threshold,
const bool overThreshold )
slot

Filters (disables) edges according the specified threshold weight.

Parameters
m_threshold
overThreshold

◆ edgeFilterUnilateral

void Graph::edgeFilterUnilateral ( const bool & toggle)
slot

Enables or disables unilateral edges in current relationship.

If toggle=true, all non-reciprocal edges are disabled, effectively making the network symmetric.

Parameters
toggle

◆ edgeInboundStatusSet()

void Graph::edgeInboundStatusSet ( const int & target,
const int & source,
const bool & toggle = false )

Toggles the status of inbound edge target <- source at target vertex.

Parameters
v1
v2
toggle
Returns

◆ edgeLabel()

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

Returns the label of edge v1->v2.

Parameters
v1
v2
Returns

◆ edgeLabelSet()

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

Changes the label of edge v1->v2.

Parameters
v1
v2
weight

◆ edgeLabelsVisibilitySet()

void Graph::edgeLabelsVisibilitySet ( const bool & toggle)

Toggles the visibility of edge labels.

Parameters
toggle

◆ edgeOutboundStatusSet()

void Graph::edgeOutboundStatusSet ( const int & source,
const int & target,
const bool & toggle = false )

Toggles the status of outbound edge source -> target at source vertex.

Parameters
v1
v2
toggle
Returns

◆ edgeRemove()

void Graph::edgeRemove ( const int & v1,
const int & v2,
const bool & removeReverse = false )

Removes the directed arc v1->v2 or, if the graph is undirected, the edge v1 <->v2.

Emits signal to GW to delete the graphics item.

Parameters
v1
v2
removeReverseif true also removes the reverse edge

◆ edgeRemoveSelected()

void Graph::edgeRemoveSelected ( SelectedEdge & selectedEdge,
const bool & removeReverse )

Removes a SelectedEdge.

Parameters
selectedEdge
removeReverse

◆ edgeRemoveSelectedAll()

void Graph::edgeRemoveSelectedAll ( )

Removes all selected edges.

◆ edgesEnabled()

int Graph::edgesEnabled ( )

Returns the number of enabled ties in the current relation.

IMPORTANT: Naming vs semantics

  • Internally, SocNetV stores adjacency as directed arcs in each vertex's out-edges.
  • For an UNDIRECTED graph, each undirected edge is represented as TWO symmetric arcs (v1->v2 and v2->v1). Therefore, summing outEdgesCount() over all vertices yields 2*E, and we must divide by 2 to return the logical undirected edge count E.
  • For a DIRECTED graph, summing outEdgesCount() over all vertices yields A (the arc count), and we return it as-is.

Caching:

  • m_totalEdges caches the internal count (sum of enabled out-arcs).
  • edgesEnabled() returns the logical count:
    • E for undirected graphs
    • A for directed graphs

TODO / THINK: Self-loops (v->v)

  • A self-loop contributes exactly 1 outbound arc in outEdgesCount().
  • In an UNDIRECTED graph, dividing m_totalEdges by 2 assumes every tie is a symmetric pair. A loop is NOT a symmetric pair, so it would be mishandled by the /2 rule.
  • Decide on a loop policy: (a) forbid loops in undirected graphs (and filter them out here), or (b) count loops separately and adjust the formula to: E = (nonLoopArcs/2) + loopArcs (where loopArcs is the number of enabled v->v arcs).
Returns
int Logical enabled ties: E (undirected) or A (directed)

◆ edgeSymmetric()

bool Graph::edgeSymmetric ( const int & v1,
const int & v2 )

Returns TRUE if edge(v1, v2) is symmetric, i.e. (v1,v2) == (v2,v1).

Parameters
v1
v2
Returns

◆ edgeTypeSet()

void Graph::edgeTypeSet ( const int & v1,
const int & v2,
const qreal & weight,
const int & dirType = EdgeType::Directed )

Changes the direction type of an existing edge.

Parameters
v1
v2
weight

◆ edgeWeight()

qreal Graph::edgeWeight ( const int & v1,
const int & v2 ) const

Returns the weight of the edge v1->v2.

Parameters
v1
v2
Returns
qreal

◆ edgeWeightNumbersVisibilitySet()

void Graph::edgeWeightNumbersVisibilitySet ( const bool & toggle)

Changes the visibility of edge weight numbers.

Parameters
toggle

◆ edgeWeightSet()

void Graph::edgeWeightSet ( const int & v1,
const int & v2,
const qreal & weight,
const bool & undirected = false )

Changes the weight of the edge from vertex v1 to v2 (and optionally of the reverse edge).

Parameters
v1
v2
weight
undirected

◆ factorial()

int Graph::factorial ( int x)

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

◆ getFileFormat()

int Graph::getFileFormat ( ) const

Returns the format of the last file opened.

Returns
int

◆ getFileName()

QString Graph::getFileName ( ) const

Returns the file name of the current graph, if any.

Returns
QString

◆ getGeodesicsCount()

int Graph::getGeodesicsCount ( )

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

Returns
int

◆ getName()

QString Graph::getName ( ) const

Returns the name of the current graph.

If graph name is empty, then returns current relation name. If no relation exists, returns "noname"

Returns
QString

◆ getProminenceIndexByName()

int Graph::getProminenceIndexByName ( const QString & prominenceIndexName)

Returns the IndexType of the given prominence index name Called from MW::slotEditNodeFind, MW::slotLayoutRadialByProminenceIndex etc.

Parameters
prominenceIndexName

◆ getSelectedEdges()

QList< SelectedEdge > Graph::getSelectedEdges ( ) const

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

Returns

◆ getSelectedEdgesCount()

int Graph::getSelectedEdgesCount ( ) const

Returns the count of user-selected edges.

Returns

◆ getSelectedVertices()

QList< int > Graph::getSelectedVertices ( ) const

Returns a QList of user-selected vertices.

Returns

◆ getSelectedVerticesCount()

int Graph::getSelectedVerticesCount ( ) const

Returns count of user-selected vertices.

Returns

◆ getSelectedVerticesMax()

int Graph::getSelectedVerticesMax ( ) const

Returns max of user-selected vertices.

Returns

◆ getSelectedVerticesMin()

int Graph::getSelectedVerticesMin ( ) const

Returns min of user-selected vertices.

Returns

◆ getThread()

QThread * Graph::getThread ( ) const

◆ graphClickedEmptySpace

void Graph::graphClickedEmptySpace ( const QPointF & p)
slot

Resets the clicked edge and node.

Usually, called when the user clicks on an empty space.

Parameters
p

◆ graphCliqueAdd()

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 co-membership matrix CLQM .

Parameters
list
Returns

◆ graphCliques()

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 NBS(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

◆ graphCliquesContaining()

int Graph::graphCliquesContaining ( const int & actor,
const int & size = 0 )

Returns the number of maximal cliques which include a given actor

◆ graphCliquesOfSize()

int Graph::graphCliquesOfSize ( const int & size)

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

Parameters
size
Returns

◆ graphClusteringHierarchical()

bool Graph::graphClusteringHierarchical ( Matrix & STR_EQUIV,
const QString & varLocation,
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:

◆ graphClusteringMethodStrToType()

int Graph::graphClusteringMethodStrToType ( const QString & method) const

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

Parameters
method
Returns

◆ graphClusteringMethodTypeToString()

QString Graph::graphClusteringMethodTypeToString ( const int & methodType) const

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

Returns

◆ graphConnectednessFull()

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

◆ graphDensity()

qreal Graph::graphDensity ( )

Gets the graph density (if computed) or computes it again.

The graph density is the ratio of present ties to total possible ties for the current relation.

IMPORTANT: edgesEnabled() semantics in SocNetV:

  • If the graph is UNDIRECTED, edgesEnabled() returns E (undirected edges), even though internally each undirected edge is stored as two symmetric arcs.
  • If the graph is DIRECTED, edgesEnabled() returns A (directed arcs).

Therefore:

  • Undirected density: 2E / (V*(V-1))
  • Directed density: A / (V*(V-1))

TODO / THINK: Self-loops (v->v)

  • The denominator V*(V-1) assumes loops are not allowed/considered.
  • If self-loops can exist and be enabled, decide whether to: (a) exclude loops from the numerator for density, or (b) use a loop-aware denominator (e.g., V*V for directed with loops).
Returns
qreal

◆ graphDiameter()

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

◆ graphDiameterCached()

int Graph::graphDiameterCached ( ) const

Returns the number of geodesics (shortest paths) in the graph, without recalculating it.

Returns
int

◆ graphDichotomization()

void Graph::graphDichotomization ( const qreal threshold)

Creates a new binary relation in a valued network using edge dichotomization according to the threshold parameter.

Parameters
threshold

◆ graphDistanceEuclidean() [1/2]

qreal Graph::graphDistanceEuclidean ( const QPointF & a)

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

Parameters
a
Returns

◆ graphDistanceEuclidean() [2/2]

qreal Graph::graphDistanceEuclidean ( const QPointF & a,
const QPointF & b )

Computes the euclideian distance between QPointF a and b.

Parameters
a
b
Returns

◆ graphDistanceGeodesic()

int Graph::graphDistanceGeodesic ( const int & v1,
const int & v2,
const bool & considerWeights = false,
const bool & inverseWeights = true )

Returns the geodesic distance (length of shortest path) from vertex v1 to vertex v2.

Parameters
v1
v2
considerWeights
inverseWeights
Returns

◆ graphDistanceGeodesicAverage()

qreal Graph::graphDistanceGeodesicAverage ( const bool considerWeights,
const bool inverseWeights,
const bool dropIsolates )

Returns the average distance of the graph.

Parameters
considerWeights
inverseWeights
dropIsolates
Returns

◆ graphDistanceGeodesicAverageCached()

qreal Graph::graphDistanceGeodesicAverageCached ( ) const

Returns the average geodesic distance of the graph, without recalculating it.

Returns
qreal

◆ graphDistancesGeodesic()

void Graph::graphDistancesGeodesic ( const bool & computeCentralities = false,
const bool & considerWeights = false,
const bool & inverseWeights = true,
const bool & dropIsolates = false )

Computes the geodesic distances between all vertices: In the process, it also computes many other centrality/prestige metrics:

  • The so-called sigma matrix, where the (i,j) element is the number of shortest paths from vertex i to vertex j, called sigma(i,j).
  • 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( d(u,t) ) for every t in V
    • Power:
      Parameters
      centralities
      considerWeights
      inverseWeights
      dropIsolates

◆ graphFileLoaded

void Graph::graphFileLoaded ( const int & fileType,
const QString & fileName = QString(),
const QString & netName = QString(),
const int & totalNodes = 0,
const int & totalLinks = 0,
const int & edgeDirType = 0,
const qint64 & elapsedTime = 0,
const QString & message = QString() )
slot

Stores loaded file name, graph name, sets edge direction type and signals MW to update the UI.

Called from Parser when file parsing ends.

Parameters
fileType
fileName
netName
totalNodes
totalLinks
edgeDirType
elapsedTime
message

◆ graphGeodesicsCountCached()

qreal Graph::graphGeodesicsCountCached ( ) const

Returns the number of geodesics (shortest paths) accumulated by DistanceEngine, without recalculating anything.

◆ graphHasVertexCustomAttributes()

QStringList Graph::graphHasVertexCustomAttributes ( ) const

Returns true if at least one vertex has a 'custom' attribute.

Returns
bool

◆ graphHasVertexCustomIcons()

bool Graph::graphHasVertexCustomIcons ( ) const

Returns true if at least one vertex has a 'custom' shape (therefore a custom icon).

Returns
bool

◆ graphLoadedTerminateParserThreads

void Graph::graphLoadedTerminateParserThreads ( QString reason)
slot

◆ graphMatrixDistanceGeodesicCreate()

void Graph::graphMatrixDistanceGeodesicCreate ( const bool & considerWeights = false,
const bool & inverseWeights = true,
const bool & dropIsolates = false )

Creates the matrix DM of geodesic distances between vertices.

Parameters
considerWeights
inverseWeights
dropIsolates

◆ graphMatrixShortestPathsCreate()

void Graph::graphMatrixShortestPathsCreate ( const bool & considerWeights = false,
const bool & inverseWeights = true,
const bool & dropIsolates = false )

Creates the matrix SIGMA of shortest paths (geodesics) between vertices Each SIGMA(i,j) is the number of shortest paths (geodesics) from i and j.

Parameters
considerWeights
inverseWeights
dropIsolates

◆ graphMatrixStrToType()

int Graph::graphMatrixStrToType ( const QString & matrix) const

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

Parameters
matrix
Returns

◆ graphMatrixTypeToString()

QString Graph::graphMatrixTypeToString ( const int & matrixType) const

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

Parameters
matrix

◆ graphMetricStrToType()

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

Helper method, return the identifier of a metric.

Parameters
metricStr

◆ graphMetricTypeToString()

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

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

Parameters
metric

◆ graphReachable()

bool Graph::graphReachable ( const int & v1,
const int & v2 )

Returns true if vertices v1 and v2 are reachable.

Parameters
v1
v2
Returns
bool

◆ graphReciprocity()

qreal Graph::graphReciprocity ( )

Gets the arc reciprocity of the graph.

Also computes the dyad reciprocity and fills parameters with values.

Returns
qreal

◆ graphSumDistanceCached()

qreal Graph::graphSumDistanceCached ( ) const

Returns the sum of all finite geodesic distances accumulated by DistanceEngine, without recalculating anything.

◆ graphTriadCensus()

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

◆ graphWalksMatrixCreate()

void Graph::graphWalksMatrixCreate ( const int & N = 0,
const int & length = 0,
const bool & updateProgress = false,
const bool & dropIsolates = false,
const bool & considerWeights = false,
const bool & inverseWeights = false,
const bool & symmetrize = 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
N- dimension of the sociomatrix (number of vertices). Default is 0, in which case it will be calculated as the number of vertices in the graph.
length- the length of walks to be calculated. Default is 0, in which case all walks of any length will be calculated.
updateProgress

◆ htmlEscaped

QString Graph::htmlEscaped ( QString str) const
slot

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

Parameters
str
Returns

◆ incGeodesicsCount()

void Graph::incGeodesicsCount ( )

◆ isCentralityIndexComputed()

bool Graph::isCentralityIndexComputed ( const IndexType index) const

Returns true if the given centrality/prestige index has been computed.

Uses the per-index calculated* flags set by each analysis method. Matches the IndexType enum defined in global.h.

◆ isConnected()

bool Graph::isConnected ( )

Checks if the graph is connected, in the sense of a topological space, i.e., there is a path from any vertex to any other vertex in the graph.

Returns
bool

◆ isConnectedCached()

bool Graph::isConnectedCached ( ) const

Returns true if the graph is connected, without recalculating it.

Returns
bool

◆ isDirected()

bool Graph::isDirected ( )

Returns true if graph is directed.

Returns
bool

◆ isEmpty()

bool Graph::isEmpty ( ) const

Returns true if the current graph has no vertices at all.

◆ isFileFormatExportSupported()

bool Graph::isFileFormatExportSupported ( const int & fileFormat) const

Returns true if the fileFormat is supported for saving.

Parameters
fileFormat
Returns

◆ isLoaded()

bool Graph::isLoaded ( ) const

Returns true if a graph has been loaded from a file.

Returns

◆ isModified()

bool Graph::isModified ( ) const

Returns true of graph is modified (edges/vertices added/removed).

Returns

◆ isSaved()

bool Graph::isSaved ( ) const

Returns true if the graph is saved.

Returns

◆ isSymmetric()

bool Graph::isSymmetric ( )

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

Returns
bool

◆ isUndirected()

bool Graph::isUndirected ( )

Returns true if graph is undirected.

Returns
bool

◆ isWeighted()

bool Graph::isWeighted ( )

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

Returns

◆ layoutByProminenceIndex()

void Graph::layoutByProminenceIndex ( int prominenceIndex,
int layoutType,
const bool & considerWeights = false,
const bool & inverseWeights = false,
const bool & dropIsolates = false )

Applies a layout according to each actor's prominence index score. The layout type can be radial (0), level (1), node sizes (2) or node colors (3), as follows: layoutType=0 - Repositions all nodes on the periphery of concentric circles with radius analogous to their prominence index layoutType=1 - Repositions all nodes on different top-down levels according to their centrality layoutType=2 - Changes node sizes to be proportional to their prominence index score layoutType=2 - Changes node colors to reflect their prominence index score (from red to green).

Parameters
prominenceIndex,0-12
layoutType0,1,2,3
considerWeights
inverseWeights
dropIsolates

◆ layoutCircular()

void Graph::layoutCircular ( const double & x0,
const double & y0,
const double & newRadius,
const bool & guides = false )

Repositions all nodes on the periphery of a circle with given radius.

Parameters
x0
y0
maxRadius

◆ layoutForceDirected_Eades_moveNodes()

void Graph::layoutForceDirected_Eades_moveNodes ( const qreal & c4)

◆ layoutForceDirected_F_att()

qreal Graph::layoutForceDirected_F_att ( const QString model,
const qreal & dist,
const qreal & optimalDistance )

◆ layoutForceDirected_F_rep()

qreal Graph::layoutForceDirected_F_rep ( const QString model,
const qreal & dist,
const qreal & optimalDistance )

◆ layoutForceDirected_FR_moveNodes()

void Graph::layoutForceDirected_FR_moveNodes ( const qreal & temperature)

Graph::layoutForceDirected_FR_moveNodes.

Parameters
temperature

◆ layoutForceDirected_FR_temperature()

qreal Graph::layoutForceDirected_FR_temperature ( const int iteration) const

Reduces the temperature as the layout approaches a better configuration.

Returns
qreal temperature

◆ layoutForceDirectedFruchtermanReingold()

void Graph::layoutForceDirectedFruchtermanReingold ( const int maxIterations)

Embeds a Force Directed Placement layout according to the Fruchterman-Reingold model. Fruchterman 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.

Parameters
maxIterations

◆ layoutForceDirectedKamadaKawai()

void Graph::layoutForceDirectedKamadaKawai ( const int maxIterations = 500,
const bool considerWeights = false,
const bool inverseWeights = false,
const bool dropIsolates = false,
const QString & initialPositions = "current" )

Embeds a Force Directed Placement layout according to the Kamada-Kawai model. In this model, the network is considered to be a dynamic system where every two actors are 'particles' mutually 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 particles Initially, the particles/actors are placed on the vertices of a regular n-polygon.

◆ layoutForceDirectedSpringEmbedder()

void Graph::layoutForceDirectedSpringEmbedder ( const int maxIterations)

Embeds a Force Directed Placement layout according to the initial Spring Embedder model proposed by Eades.

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)

◆ layoutRadialRandom()

void Graph::layoutRadialRandom ( const bool & guides = true)

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

Parameters
x0
y0
maxRadius

◆ layoutRandom()

void Graph::layoutRandom ( )

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

Parameters
maxWidth
maxHeight

◆ layoutVertexSizeByIndegree()

void Graph::layoutVertexSizeByIndegree ( )

Convenience method Changes the size of all nodes to be proportional to their InDegree (Degree Prestige) Calls layoutByProminenceIndex.

◆ layoutVertexSizeByOutdegree()

void Graph::layoutVertexSizeByOutdegree ( )

Convenience method Changes the size of all nodes to be proportional to their outDegree (Degree Centrality) Calls layoutByProminenceIndex.

◆ loadFile()

void Graph::loadFile ( const QString fileName,
const QString codecName,
const int fileFormat,
const QString delimiter = QString(),
const int sm_two_mode = 1,
const bool sm_has_labels = false )

Loads a graph from a given file.

It creates a new Parser object, moves it to a another thread, connects signals and slots and calls its run() method.

Parameters
fileName
codecName
m_showLabels
maxWidth
maxHeight
fileFormat
sm_two_mode
Returns

◆ minmax()

void Graph::minmax ( qreal C,
GraphVertex * v,
qreal & max,
qreal & min,
int & maxNode,
int & minNode )
private

Computes minimum and maximum centralities during graphDistancesGeodesic().

Parameters
C
v
max
min
maxNode
minNode

◆ moveToThreadFacade()

void Graph::moveToThreadFacade ( QThread * thread)

◆ notConnectedPairsClear()

void Graph::notConnectedPairsClear ( )

◆ notConnectedPairsInsert()

void Graph::notConnectedPairsInsert ( int from,
int to )

◆ notConnectedPairsSize()

int Graph::notConnectedPairsSize ( ) const

◆ numberOfTriples()

qreal 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.

◆ prestigeDegree()

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

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

Parameters
weights
dropIsolates

◆ prestigePageRank()

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

Calculates the PageRank Prestige of each vertex.

Parameters
dropIsolates

◆ prestigeProximity()

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

Computes Proximity Prestige of each vertex Also the mean value and the variance of it..

◆ progressCreate()

void Graph::progressCreate ( int max,
const QString & msg )
protected

Emits a signal to create a progress box in the UI with the given maximum value and message.

Parameters
maxThe maximum value for the progress box.
msgThe message to be shown in the progress box.

◆ progressFinish()

void Graph::progressFinish ( )
protected

Emits a signal to kill the progress box in the UI, indicating that the operation is complete.

◆ progressStatus()

void Graph::progressStatus ( const QString & msg)
protected

Emits a status message to be shown in the UI status bar.

Parameters
msgThe message to be shown.

◆ progressUpdate()

void Graph::progressUpdate ( int value)
protected

Emits a signal to update the progress box in the UI with the given value.

Parameters
valueThe current value to update the progress box with.

◆ prominenceDistribution()

void Graph::prominenceDistribution ( const int & index,
const ChartType & type,
const QString & distImageFileName = QString() )

Computes the distribution of a centrality index score. The distribution is stored as Qt Series depending on the SeriesType parameter type It is send to MW through signal/slot.

Parameters
index
type

◆ prominenceDistributionArea()

void Graph::prominenceDistributionArea ( const H_StrToInt & discreteClasses,
const QString & name,
const QString & distImageFileName )

Computes prominence distribution data and delegates Area chart rendering.

Performs the algorithmic portion only:

  • Orders (value, frequency) pairs derived from discreteClasses
  • Computes min/max value and min/max frequency

UI construction (Qt Charts series/axes), optional PNG export, and emission of signalPromininenceDistributionChartUpdate(...) are delegated to the UI façade implementation in graph_ui_prominence_distribution.cpp (WS2/F4).

Behavior and output semantics are preserved.

Parameters
discreteClassesMap of value (string) -> frequency.
nameDisplay name of the series.
distImageFileNameIf non-empty, export chart to this PNG file.

◆ prominenceDistributionBars()

void Graph::prominenceDistributionBars ( const H_StrToInt & discreteClasses,
const QString & name,
const QString & distImageFileName )

Computes the prominence distribution and delegates Bar chart rendering.

This method performs only the algorithmic portion: it derives ordered category labels (centrality values formatted with 6 decimals), the matching frequencies, and computes basic range statistics:

  • min/max value (numeric)
  • min/max frequency

UI construction (Qt Charts objects, axes, optional PNG export) and emission of the update signal to MainWindow are delegated to the UI façade layer (graph_ui_prominence_distribution.cpp), following WS2/F4 rules.

Behavior, rendering semantics, and export output remain unchanged.

Parameters
discreteClassesA map of centrality value (as string) to frequency.
nameThe display name of the distribution series.
distImageFileNameIf non-empty, the chart is exported to this PNG file.

◆ prominenceDistributionSpline()

void Graph::prominenceDistributionSpline ( const H_StrToInt & discreteClasses,
const QString & seriesName,
const QString & distImageFileName )

Computes prominence distribution data and delegates Spline chart rendering.

Performs the algorithmic portion only:

  • Orders (value, frequency) pairs derived from discreteClasses
  • Computes min/max value and min/max frequency

UI construction (Qt Charts series/axes), optional PNG export, and emission of signalPromininenceDistributionChartUpdate(...) are delegated to the UI façade implementation in graph_ui_prominence_distribution.cpp (WS2/F4).

Behavior and output semantics are preserved.

Parameters
discreteClassesMap of value (string) -> frequency.
seriesNameDisplay name of the series.
distImageFileNameIf non-empty, export chart to this PNG file.

◆ randomizeThings()

void Graph::randomizeThings ( )

Adds a little universal randomness :).

RANDOM NETWORKS

◆ randomNetErdosCreate()

void Graph::randomNetErdosCreate ( const int & N,
const QString & model,
const int & m,
const qreal & p,
const QString & mode,
const bool & diag )

Creates an erdos-renyi random network according to the given model.

Parameters
vert
model
edges
eprob
mode
diag

◆ randomNetLatticeCreate()

void Graph::randomNetLatticeCreate ( const int & N,
const int & length,
const int & dimension,
const int & neighborhoodLength,
const QString & mode,
const bool & circular = false )

Creates a lattice network.

Parameters
N
length
dimension
neighborhood
mode
diag

◆ randomNetRegularCreate()

void Graph::randomNetRegularCreate ( const int & N,
const int & degree,
const QString & mode,
const bool & diag )

Creates a random network where nodes have the same degree.

Parameters
vert
degree

◆ randomNetRingLatticeCreate()

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

Creates a random ring lattice network.

Parameters
vert
degree
x0
y0
radius
updateProgress

◆ randomNetScaleFreeCreate()

void Graph::randomNetScaleFreeCreate ( const int & N,
const int & power,
const int & m0,
const int & m,
const qreal & alpha,
const QString & mode )

Creates a scale-free random-network network.

Parameters
N
power
m0
m
alpha
mode

◆ randomNetSmallWorldCreate()

void Graph::randomNetSmallWorldCreate ( const int & N,
const int & degree,
const double & beta,
const QString & mode )

Creates a small world random network.

Parameters
vert
degree
beta

◆ relationAdd()

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

Adds a new relation to the graph.

Adds a new relation named relName, emitting signal to MW UI, and optionally changing current graph relation to the new one. Called by file parser and various Graph methods, i.e clear() etc.

Parameters
relName

◆ relationAddCocitation()

void Graph::relationAddCocitation ( )

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.

◆ relationCurrent

int Graph::relationCurrent ( )
slot

Gets the current relation number.

Returns
int

◆ relationCurrentName

QString Graph::relationCurrentName ( ) const
slot

Gets the current relation name.

Returns
string

◆ relationCurrentRename [1/2]

void Graph::relationCurrentRename ( const QString & newName)
slot

Overload. Renames current relation to newName, without emitting any signal to MW.

Parameters
newName

◆ relationCurrentRename [2/2]

void Graph::relationCurrentRename ( const QString & newName,
const bool & signalMW )
slot

Renames current relation to newName, optionally emitting a signal to MW.

Parameters
newName

◆ relationNext

void Graph::relationNext ( )
slot

Changes graph to next relation.

◆ relationPrev

void Graph::relationPrev ( )
slot

Changes graph to previous relation.

◆ relations()

int Graph::relations ( )

Returns the count of relationships in this Graph.

Returns
int

◆ relationsClear()

void Graph::relationsClear ( )

Clears relationships in this Graph.

◆ relationSet

void Graph::relationSet ( int relNum = RAND_MAX,
const bool & updateUI = true )
slot

Changes the current relation, and optionally emits signals to MW/GW (default: true).

Slots to signals from MainWindow

Forces all enabled vertices to disable edges in the old relation and enable edges of the new relation

Then, if updateUI==true (default), it emits signals to MW and GW to update the MW UI and toggle the edges on the GW, respectivelly.

Called from Parser, Graph methods and when the user selects a relation in the MW combo box.

Parameters
relNumint
updateUIbool

◆ resetDistanceAggregates()

void Graph::resetDistanceAggregates ( )

◆ resetDistanceCentralityCacheFlags()

void Graph::resetDistanceCentralityCacheFlags ( )

◆ resolveClasses() [1/2]

void Graph::resolveClasses ( qreal C,
H_StrToInt & discreteClasses,
int & classes )
private

Checks if score C is a new prominence class If yes, it stores that number in a QHash<QString,int> type where the score is the key. If no, increases the frequency of this prominence score by 1 Called from graphDistancesGeodesic().

Parameters
C
discreteClasses
classes

◆ resolveClasses() [2/2]

void Graph::resolveClasses ( qreal C,
H_StrToInt & discreteClasses,
int & classes,
int vertex )
private

Overloaded method. It only adds displaying current vertex for debugging purposes.

Parameters
C
discreteClasses
classes
vertex

◆ saveToAdjacencyFormat()

bool Graph::saveToAdjacencyFormat ( const QString & fileName,
const bool & saveEdgeWeights = true )

Saves the active graph to an adjacency-formatted file.

Parameters
fileName
Returns
bool

◆ saveToDotFormat()

bool Graph::saveToDotFormat ( QString fileName)

TODO Saves the active graph to a UCINET-formatted file.

Parameters
fileName
Returns
bool

◆ saveToFile()

void Graph::saveToFile ( const QString & fileName,
const int & fileType,
const bool & saveEdgeWeights = true,
const bool & saveZeroWeightEdges = false )

Saves the current graph to a file.

Checks the requested file type and calls the corresponding saveGraphTo...() method

Parameters
fileName
fileType

◆ saveToGraphMLFormat()

bool Graph::saveToGraphMLFormat ( const QString & fileName,
const bool & saveZeroWeightEdges = false,
QString networkName = "",
int maxWidth = 0,
int maxHeight = 0 )

Saves the current graph to a GraphML-formatted file.

Parameters
fileName
networkName
maxWidth
maxHeight
Returns
bool

◆ saveToPajekFormat()

bool Graph::saveToPajekFormat ( 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)

Parameters
fileName
networkName
maxWidth
maxHeight
Returns
bool

◆ setAverageDistanceCached()

void Graph::setAverageDistanceCached ( qreal v)

◆ setConnectedCached()

void Graph::setConnectedCached ( bool v)

◆ setDiameterCached()

void Graph::setDiameterCached ( int v)

◆ setDirected()

void Graph::setDirected ( const bool & toggle = true,
const bool & signalMW = true )

Toggles the graph directed or undirected.

Parameters
toggle
signalMW

◆ setEdgeColor

void Graph::setEdgeColor ( const int & v1,
const int & v2,
const QString & color )
signal

◆ setEdgeLabel

void Graph::setEdgeLabel ( const int & v1,
const int & v2,
const QString & label )
signal

◆ setEdgeWeight

void Graph::setEdgeWeight ( const int & v1,
const int & v2,
const qreal & weight )
signal

◆ setFileFormat()

void Graph::setFileFormat ( const int & fileFormat)

◆ setFileName()

void Graph::setFileName ( const QString & fileName)

Sets the file name of the current graph.

Parameters
fileName

◆ setModStatus()

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

Sets the graph modification status.

If there are major changes or new network, it signals to MW to update the UI.

Parameters
intgraphNewStatus
boolsignalMW

◆ setName()

void Graph::setName ( const QString & graphName)

Sets the name of the current graph.

Parameters
graphName

◆ setNodeColor

void Graph::setNodeColor ( const int & v,
const QString & color )
signal

◆ setNodeLabel

void Graph::setNodeLabel ( const int & v,
const QString & label )
signal

◆ setNodeLabelColor

void Graph::setNodeLabelColor ( const int & v,
const QString & color )
signal

◆ setNodeLabelDistance

void Graph::setNodeLabelDistance ( const int & v,
const int & distance )
signal

◆ setNodeLabelSize

void Graph::setNodeLabelSize ( const int & v,
const int & size )
signal

◆ setNodeNumberColor

void Graph::setNodeNumberColor ( const int & v,
const QString & color )
signal

◆ setNodeNumberDistance

void Graph::setNodeNumberDistance ( const int & v,
const int & distance )
signal

◆ setNodeNumberSize

void Graph::setNodeNumberSize ( const int & v,
const int & size )
signal

◆ setNodePos

void Graph::setNodePos ( const int & ,
const qreal & ,
const qreal &  )
signal

◆ setNodeShape

void Graph::setNodeShape ( const int & v,
const QString & shape,
const QString & iconPath = QString() )
signal

◆ setNodeSize

void Graph::setNodeSize ( const int & v,
const int & size )
signal

◆ setReportsChartType()

void Graph::setReportsChartType ( const int & type)

Sets the chart type in reports.

Parameters
type

◆ setReportsDataDir()

void Graph::setReportsDataDir ( const QString & dir)

Sets the directory where reports are saved This is used when exporting prominence distribution images to be used in HTML reports.

Parameters
dir

◆ setReportsLabelLength()

void Graph::setReportsLabelLength ( const int & length)

Sets the length of labels in reports.

Parameters
length

◆ setReportsRealNumberPrecision()

void Graph::setReportsRealNumberPrecision ( const int & precision)

Sets the precision (number of fraction digits) the app will use when writing real numbers in reports.

Parameters
precision

◆ setSelectionChanged

void Graph::setSelectionChanged ( const QList< int > selectedVertices,
const QList< SelectedEdge > selectedEdges )
slot

Sets the user-selected vertices and edges.

Usually called from GW, it emits selection counts to MW

Parameters
selectedVertices
selectedEdges

◆ setSymmetric()

void Graph::setSymmetric ( )

Transforms the graph to symmetric (all edges reciprocal).

◆ setSymmetricCached()

void Graph::setSymmetricCached ( bool v)

◆ setUndirected()

void Graph::setUndirected ( const bool & toggle = true,
const bool & signalMW = true )

Makes the graph undirected or directed.

Parameters
toggle
signalMW

◆ setVertexVisibility

void Graph::setVertexVisibility ( const int & number,
const bool & toggle )
signal

◆ setWeighted()

void Graph::setWeighted ( const bool & toggle = true)

Sets the graph to be weighted ( valued edges ).

Parameters
toggle

◆ sign()

int Graph::sign ( const qreal & D)

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

Parameters
D
Returns

◆ signalDatasetDescription

void Graph::signalDatasetDescription ( QString )
signal

◆ signalDrawEdge

void Graph::signalDrawEdge ( const int & v1,
const int & v2,
const qreal & weight,
const QString & label = "",
const QString & color = "black",
const int & type = 0,
const bool & drawArrows = true,
const bool & bezier = false,
const bool & weightNumbers = false )
signal

◆ signalDrawNode

void Graph::signalDrawNode ( const QPointF & p,
const int & num,
const int & size,
const QString & nodeShape,
const QString & nodeIconPath,
const QString & nodeColor,
const QString & numberColor,
const int & numSize,
const int & numDistance,
const QString & label,
const QString & labelColor,
const int & labelSize,
const int & labelDistance )
signal

Signals to GraphicsWidget

◆ signalEdgeClicked

void Graph::signalEdgeClicked ( const MyEdge & edge = MyEdge(),
const bool & openMenu = false )
signal

◆ signalEdgeType

void Graph::signalEdgeType ( const int & v1,
const int & v2,
const int & type )
signal

◆ signalGraphLoaded

void Graph::signalGraphLoaded ( const int & fileType,
const QString & fileName = QString(),
const QString & netName = QString(),
const int & totalNodes = 0,
const int & totalLinks = 0,
const qreal & density = 0,
const qint64 & elapsedTime = 0,
const QString & message = QString() )
signal

◆ signalGraphModified

void Graph::signalGraphModified ( const bool & undirected,
const int & vertices,
const int & edges,
const qreal & density,
const bool & notSaved = true )
signal

◆ signalGraphSavedStatus

void Graph::signalGraphSavedStatus ( const int & status)
signal

◆ signalNetworkManagerRequest

void Graph::signalNetworkManagerRequest ( const QUrl & currentUrl,
const NetworkRequestType & type )
signal

Signals to MainWindow

◆ signalNodeClickedInfo

void Graph::signalNodeClickedInfo ( const int & number = 0,
const QPointF & p = QPointF(),
const QString & label = QString(),
const int & inDegree = 0,
const int & outDegree = 0 )
signal

◆ signalNodesFound

void Graph::signalNodesFound ( const QList< int > foundList)
signal

◆ signalProgressBoxCreate

void Graph::signalProgressBoxCreate ( const int max = 0,
const QString msg = "Please wait" )
signal

◆ signalProgressBoxKill

void Graph::signalProgressBoxKill ( const int max = 0)
signal

◆ signalProgressBoxUpdate

void Graph::signalProgressBoxUpdate ( const int & count = 0)
signal

◆ signalPromininenceDistributionChartUpdate

void Graph::signalPromininenceDistributionChartUpdate ( QAbstractSeries * series,
QAbstractAxis * axisX = Q_NULLPTR,
const qreal & min = 0,
const qreal & max = 0,
QAbstractAxis * axisY = Q_NULLPTR,
const qreal & minF = 0,
const qreal & maxF = 0 )
signal

◆ signalRelationAddToMW

void Graph::signalRelationAddToMW ( const QString & newRelation)
signal

◆ signalRelationChangedToGW

void Graph::signalRelationChangedToGW ( int )
signal

◆ signalRelationChangedToMW

void Graph::signalRelationChangedToMW ( const int & relIndex = RAND_MAX)
signal

◆ signalRelationRenamedToMW

void Graph::signalRelationRenamedToMW ( const QString & newRelName)
signal

◆ signalRelationsClear

void Graph::signalRelationsClear ( )
signal

◆ signalRemoveEdge

void Graph::signalRemoveEdge ( const int & v1,
const int & v2,
const bool & removeReverse )
signal

◆ signalRemoveNode

void Graph::signalRemoveNode ( int )
signal

◆ signalSelectionChanged

void Graph::signalSelectionChanged ( const int & selectedVertices,
const int & selectedEdges )
signal

◆ signalSetEdgeVisibility

void Graph::signalSetEdgeVisibility ( const int & relation,
const int & source,
const int & target,
const bool & toggle,
const bool & preserveReverseEdge = false,
const int & edgeWeight = 1,
const int & reverseEdgeWeight = 1 )
signal

◆ signalWebCrawlParse

void Graph::signalWebCrawlParse ( QNetworkReply * reply)
signal

◆ slotHandleCrawlerRequestReply

void Graph::slotHandleCrawlerRequestReply ( )
slot

Gets the reply of a MW network request made by Web Crawler, and emits that reply as is to the Web Crawler.

◆ ssspComponentAdd()

void Graph::ssspComponentAdd ( int delta)

◆ ssspComponentReset()

void Graph::ssspComponentReset ( int value = 1)

◆ ssspComponentSize()

int Graph::ssspComponentSize ( ) const

◆ ssspNthOrderBegin()

H_f_i::const_iterator Graph::ssspNthOrderBegin ( ) const

◆ ssspNthOrderClear()

void Graph::ssspNthOrderClear ( )

◆ ssspNthOrderEnd()

H_f_i::const_iterator Graph::ssspNthOrderEnd ( ) const

◆ ssspNthOrderIncrement() [1/2]

void Graph::ssspNthOrderIncrement ( int dist)

◆ ssspNthOrderIncrement() [2/2]

void Graph::ssspNthOrderIncrement ( qreal dist)

◆ ssspNthOrderValue()

int Graph::ssspNthOrderValue ( qreal dist) const

◆ ssspStackClear()

void Graph::ssspStackClear ( )

◆ ssspStackEmpty()

bool Graph::ssspStackEmpty ( ) const

◆ ssspStackPop()

void Graph::ssspStackPop ( )

◆ ssspStackPush()

void Graph::ssspStackPush ( int v)

◆ ssspStackSize()

int Graph::ssspStackSize ( ) const

◆ ssspStackTop()

int Graph::ssspStackTop ( ) const

◆ startWebCrawler

void Graph::startWebCrawler ( const QUrl & startUrl,
const QStringList & urlPatternsIncluded,
const QStringList & urlPatternsExcluded,
const QStringList & linkClasses,
const int & maxNodes,
const int & maxLinksPerPage,
const bool & intLinks,
const bool & childLinks,
const bool & parentLinks,
const bool & selfLinks,
const bool & extLinksIncluded,
const bool & extLinksCrawl,
const bool & socialLinks,
const bool & delayedRequests )
slot

Creates a new WebCrawler, that will parse the downloaded HTML code of each webpage we download. Moves the WebCrawler to a new thread and starts the thread. Then creates the fist node (initial url), and starts the web spider to download the first HTML page. Called by MW with user options.

Parameters
startUrl
urlPatternsIncluded
urlPatternsExcluded
linkClasses
maxNodes
maxLinksPerPage
intLinks
childLinks
parentLinks
selfLinks
extLinksIncluded
extLinksCrawl
socialLinks
delayedRequests

◆ statusMessage

void Graph::statusMessage ( const QString & message)
signal

◆ symmetricCached()

bool Graph::symmetricCached ( ) const

◆ triadType_examine_MAN_label()

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

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

◆ uiProminenceDistributionArea()

void Graph::uiProminenceDistributionArea ( const QVector< QPair< qreal, qreal > > & points,
const qreal min,
const qreal max,
const qreal minF,
const qreal maxF,
const QString & name,
const QString & distImageFileName )
protected

◆ uiProminenceDistributionBars()

void Graph::uiProminenceDistributionBars ( const QStringList & categories,
const QVector< qreal > & frequencies,
const qreal min,
const qreal max,
const qreal minF,
const qreal maxF,
const QString & name,
const QString & distImageFileName )
protected

◆ uiProminenceDistributionSpline()

void Graph::uiProminenceDistributionSpline ( const QVector< QPair< qreal, qreal > > & points,
qreal min,
qreal max,
qreal minF,
qreal maxF,
const QString & seriesName,
const QString & distImageFileName )
protected

◆ vertexAtIndex() [1/2]

GraphVertex * Graph::vertexAtIndex ( int idx)

Returns the vertex at a given index.

Parameters
idx
Returns
GraphVertex*

◆ vertexAtIndex() [2/2]

const GraphVertex * Graph::vertexAtIndex ( int idx) const

Returns the vertex at a given index.

Parameters
idx
Returns
GraphVertex*

◆ vertexClicked()

int Graph::vertexClicked ( ) const

Returns the number of the clicked vertex.

Returns
int

◆ vertexClickedSet

void Graph::vertexClickedSet ( const int & v1,
const QPointF & p )
slot

Sets the clicked vertex.

Signals to MW to show node info on the status bar.

Parameters
v1
p

◆ vertexColor()

QColor Graph::vertexColor ( const int & v1) const

Graph::vertexColor.

Parameters
v1
Returns

◆ vertexColorInit()

void Graph::vertexColorInit ( const QString & color)

Graph::vertexColorInit default vertex color initialization.

Parameters
color

◆ vertexColorSet()

void Graph::vertexColorSet ( const int & v1,
const QString & color )

Changes the color of vertex v1.

Parameters
v1
color

◆ vertexCreate

void Graph::vertexCreate ( const int & number,
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,
const QString & iconPath = QString(),
const bool & signalMW = false,
const QHash< QString, QString > & customAttributes = QHash<QString, QString>() )
slot

Creates a new vertex.

Slots to signals from Parser

Main vertex creation slot, associated with homonymous signal from Parser. Adds a vertex to the Graph and signals drawNode to GW The new vertex has number num and specific color, label, label color, shape and position p.

Parameters
num
size
nodeColor
numColor
numSize
label
lColor
lSize
p
nodeShape
signalMW

◆ vertexCreateAtPos

void Graph::vertexCreateAtPos ( const QPointF & p)
slot

Creates a new vertex in the given position.

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

Parameters
QPointFThe clicked pos of the new node.

◆ vertexCreateAtPosRandom

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

Creates a new randomly positioned vertex with default values.

Computes a random position p inside the useable canvas area Then calls the main creation slot with init node values.

Parameters
bool

◆ vertexCreateAtPosRandomWithLabel

void Graph::vertexCreateAtPosRandomWithLabel ( const int & i,
const QString & label,
const bool & signalMW = false )
slot

Creates a new randomly positioned vertex with specific number and label. All other values are from the defaults.

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.

Parameters
i
label
signalMW

◆ vertexCustomAttributes()

QHash< QString, QString > Graph::vertexCustomAttributes ( const int & v1) const

Calls the customAttributes method for a specific vertex in the graph.

This function retrieves the vertex at the position specified by the index v1 from the vpos map and calls its customAttributes method.

Parameters
v1The index of the vertex whose custom attributes are to be accessed.

◆ vertexCustomAttributesSet()

void Graph::vertexCustomAttributesSet ( const int & v1,
const QHash< QString, QString > & customAttributes )

Sets custom attributes for a specified vertex.

This function assigns a set of custom attributes to a vertex identified by its index. It also updates the modification status to indicate that vertex metadata has been changed.

Parameters
v1The index of the vertex for which custom attributes are being set.
customAttributesA QHash containing the custom attributes to be set for the vertex. The keys and values of the QHash are both QStrings.

◆ vertexDegreeIn()

int Graph::vertexDegreeIn ( int v1)

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

Parameters
v1
Returns

◆ vertexDegreeOut()

int Graph::vertexDegreeOut ( int v1)

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

Parameters
v1
Returns

◆ vertexEdgesInbound()

int Graph::vertexEdgesInbound ( int v1)

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

Parameters
v1
Returns
int

◆ vertexEdgesOutbound()

int Graph::vertexEdgesOutbound ( int v1)

Returns the number of outbound edges (arcs) from vertex v1.

Parameters
v1
Returns

◆ vertexExists() [1/2]

int Graph::vertexExists ( const int & v1)

Checks if the given vertex exists in the graph.

Returns the vpos or -1

Complexity: O(logN) for vpos retrieval

Parameters
vertexnumber
Returns
vertex pos or -1

◆ vertexExists() [2/2]

int Graph::vertexExists ( const QString & label)

Checks if there is a vertex with a specific label exists in the graph.

Returns the vpos or -1

Complexity: O(N)

Parameters
label
Returns
vpos or -1

◆ vertexFilterByCentrality

void Graph::vertexFilterByCentrality ( const float threshold,
const bool overThreshold,
const IndexType centralityIndex )
slot

Filters vertices by their score on the given centrality or prestige index.

Performs two passes over the graph:

  • Pass 1: Enables or disables each vertex depending on whether its score satisfies the threshold condition. Emits setVertexVisibility for every vertex whose state changes.
  • Pass 2: Updates all edges. An edge is made visible only when both its source and target vertices are enabled after pass 1. Emits signalSetEdgeVisibility for every out-edge of every vertex.

The two-pass design is required so that edge visibility can be determined correctly: during pass 2 all vertices are already in their final enabled state, so both endpoints of any edge can be queried reliably.

Calling this function with a threshold that no vertex satisfies (e.g. DC >= 999999) effectively re-enables all vertices and their edges, serving as the undo mechanism.

Returns early with a status message if the requested index has not been computed yet — the user should run the corresponding analysis first.

Parameters
thresholdScore threshold to compare against.
overThresholdIf true, disable vertices with score >= threshold; if false, disable vertices with score <= threshold.
centralityIndexThe centrality or prestige index to use, as defined by the IndexType enum in global.h. Must match an entry in prominenceIndexList (1-based).
See also
isCentralityIndexComputed()
IndexType

◆ vertexFindByIndexScore()

bool Graph::vertexFindByIndexScore ( const int & index,
const QStringList & thresholds,
const bool & considerWeights,
const bool & inverseWeights = false,
const bool & dropIsolates = false )

Finds vertices by their index score.

Parameters
QStringList
Returns

◆ vertexFindByLabel()

bool Graph::vertexFindByLabel ( const QStringList & labelList)

Finds vertices by their label.

Parameters
QStringList
Returns

◆ vertexFindByNumber()

bool Graph::vertexFindByNumber ( const QStringList & numList)

Finds vertices in strList by their number.

Parameters
QStringList
Returns

◆ vertexIndexByNumber()

int Graph::vertexIndexByNumber ( int v) const

Returns the index of a vertex by its number.

Returns the vpos or -1

Complexity: O(logN) for vpos retrieval

Parameters
vertexnumber
Returns
vertex pos or -1

◆ vertexinfluenceDomain()

QList< int > Graph::vertexinfluenceDomain ( int v1)

Returns the influence domain of vertex v1, namely the set of nodes who can reach v1 The Influence Domain Ii of vertex v can also be defined as: Ii = Sum [ D(i,v), iff D(i,v) != inf ] for every in V, where i!=v and D the distance matrix This function applies to digraphs only.

Parameters
v1
Returns

◆ vertexinfluenceRange()

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

Returns the influence range of vertex v1, namely the set of nodes who are reachable from v1 (See Wasserman and Faust, pp.200-201, based on Lin, 1976). The Influence Range of vertex v can also be defined as: Ji = Sum [ D(v,j), iff D(v,j) != inf ] for every j in V, where j!=v and D the distance matrix This function is for digraphs only.

Parameters
v1
Returns

◆ vertexIsolated()

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

Checks if vertex is isolated.

Parameters
v1
Returns

◆ vertexIsolatedAllToggle

void Graph::vertexIsolatedAllToggle ( const bool & toggle)
slot

Toggles the status of all isolated vertices (those without links).

For each isolate vertex in the Graph, emits the setVertexVisibility signal

Parameters
toggle

◆ vertexLabel()

QString Graph::vertexLabel ( const int & v) const

Returns the label of a vertex v1.

Parameters
v1
Returns

◆ vertexLabelColorInit()

void Graph::vertexLabelColorInit ( QString color)

Graph::vertexLabelColorInit Changes the default vertex label color.

Parameters
color

◆ vertexLabelColorSet()

void Graph::vertexLabelColorSet ( const int & v1,
const QString & color )

Changes the label color of vertex v1 or all vertices if v1 = 0.

Parameters
v1
color

◆ vertexLabelDistanceAllSet()

void Graph::vertexLabelDistanceAllSet ( const int & newDistance)

Changes the distance of all vertex labels from their vertices.

Parameters
size

◆ vertexLabelDistanceInit()

void Graph::vertexLabelDistanceInit ( const int & distance)

Changes the default distance of vertex labels.

Parameters
distance

◆ vertexLabelDistanceSet()

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

Changes the distance.of vertex v label from the vertex.

Parameters
v
size

◆ vertexLabelSet()

void Graph::vertexLabelSet ( const int & v1,
const QString & label )

Changes the label of a vertex v1.

Parameters
v1
label

◆ vertexLabelSizeInit()

void Graph::vertexLabelSizeInit ( int newSize)

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

Parameters
newSize

◆ vertexLabelSizeSet()

void Graph::vertexLabelSizeSet ( const int & v1,
const int & labelSize )

Changes the label size of vertex v1 or all vertices if v1=0.

Parameters
v1
size

◆ vertexLabelsVisibilitySet()

void Graph::vertexLabelsVisibilitySet ( bool toggle)

◆ vertexNeighborhoodList()

QList< int > Graph::vertexNeighborhoodList ( const int & v1)

Returns a list of all vertices mutually connected to vertex v1 in the current relation.

Parameters
v1
Returns
QList<int>

◆ vertexNeighborhoodSet()

QSet< int > Graph::vertexNeighborhoodSet ( const int & v1)

Returns the set of all vertices mutually connected to vertex v1 in the current relation.

Parameters
v1
Returns
QList<int>

◆ vertexNumberColorInit()

void Graph::vertexNumberColorInit ( const QString & color)

Changes the initial color of the vertex numbers.

Parameters
color

◆ vertexNumberColorSet()

void Graph::vertexNumberColorSet ( const int & v1 = 0,
const QString & color = "#000000" )

Graph::vertexColorSet Changes the color of vertex v1.

Parameters
v1
color

◆ vertexNumberDistanceInit()

void Graph::vertexNumberDistanceInit ( const int & distance)

Changes the initial distance of vertex numbers.

Parameters
distance

◆ vertexNumberDistanceSet()

void Graph::vertexNumberDistanceSet ( const int & v,
const int & newDistance )

Changes the distance.of vertex v number from the vertex.

Parameters
v
size

◆ vertexNumberMax()

int Graph::vertexNumberMax ( )

Returns the number of the last vertex in the graph.

Returns
int

◆ vertexNumberMin()

int Graph::vertexNumberMin ( )

Returns the number of the first vertex in the graph.

Returns
int

◆ vertexNumberSizeInit()

void Graph::vertexNumberSizeInit ( const int & size)

Changes the initial size of vertex numbers.

Parameters
size

◆ vertexNumberSizeSet()

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

Changes the size of vertex v number.

Parameters
v
size

◆ vertexPos()

QPointF Graph::vertexPos ( const int & v1) const

Returns the position of the given vertex.

Parameters
v1
Returns

◆ vertexPosSet()

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

Changes the position of the given vertex.

Called from MW/GW when node moves to update its position

Parameters
v1
x
y

◆ vertexPtr()

GraphVertex * Graph::vertexPtr ( const int v)

◆ vertexRemove()

void Graph::vertexRemove ( const int & v1)

Removes the vertex v1 from the graph First, it removes all edges to doomed from other vertices Then it changes the vpos of all subsequent vertices inside m_graph Finally, it removes the vertex.

Parameters
intv1

◆ vertexRemoveDummyNode

void Graph::vertexRemoveDummyNode ( int i)
slot

Deletes a dummy node.

This is called from Parser (as pajek) to delete any redundant (dummy) nodes.

Parameters
inti number of node

◆ vertexShape()

QString Graph::vertexShape ( const int & v1)

Returns the shape of this vertex.

Parameters
v1
Returns

◆ vertexShapeIconPath()

QString Graph::vertexShapeIconPath ( const int & v1)

Returns the IconPath of vertex v1.

Parameters
v1
Returns

◆ vertexShapeSet()

void Graph::vertexShapeSet ( const int & v1,
const QString & shape,
const QString & iconPath = QString() )

Changes the shape and iconPath of vertex v1, or all vertices if v1=-1.

Parameters
v1
shape
iconPath

◆ vertexShapeSetDefault()

void Graph::vertexShapeSetDefault ( const QString shape,
const QString & iconPath = QString() )

Sets the default vertex shape and iconPath.

Parameters
shape
iconPath

◆ vertexSize()

int Graph::vertexSize ( const int & v) const

Returns the size of vertex v.

Parameters
v
Returns
int

◆ vertexSizeInit()

void Graph::vertexSizeInit ( const int size)

Sets the initial vertex size.

Parameters
size

◆ vertexSizeSet()

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

Changes the size of a vertex v or all vertices if v=0.

Called from MW (i.e. user changing node properties)

Parameters
v
size

◆ vertices()

int Graph::vertices ( const bool & dropIsolates = false,
const bool & countAll = false,
const bool & recount = false )

Gets the number of vertices in the 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

◆ verticesBegin()

VList::const_iterator Graph::verticesBegin ( ) const

iterator helpers

◆ verticesCreateSubgraph()

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_verticesSelected.

Parameters
vList

◆ verticesEnd()

VList::const_iterator Graph::verticesEnd ( ) const

◆ verticesList()

QList< int > Graph::verticesList ( )

Returns a list of all vertices numbers inside the graph.

Returns
QList<int>

◆ verticesListIsolated()

QList< int > Graph::verticesListIsolated ( )

Returns a list of all isolated vertices inside the graph.

Returns
QList<int>

◆ verticesSet()

QSet< int > Graph::verticesSet ( )

Returns a QSet of all vertices numbers inside the graph.

Returns

◆ verticesWithInboundEdges()

int Graph::verticesWithInboundEdges ( )

Returns the sum of vertices having edgesInbound.

Returns

◆ verticesWithOutboundEdges()

int Graph::verticesWithOutboundEdges ( )

Returns the sum of vertices having edgesOutbound.

Returns

◆ verticesWithReciprocalEdges()

int Graph::verticesWithReciprocalEdges ( )

Returns the sum of vertices having reciprocal edges.

Returns

◆ walksBetween()

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

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

Parameters
v1
v2
length
Returns

◆ webCrawlTerminateThreads()

void Graph::webCrawlTerminateThreads ( QString reason)

called from Graph, when closing network, to terminate all crawler processes Also called indirectly when wc_spider finishes

Parameters
reason

◆ webSpider

void Graph::webSpider ( )
slot

A loop, that takes urls awaiting in front of the urlQueue, and signals to the MW to make the network request.

◆ writeCentralityBetweenness()

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

Writes Betweenness centralities to file.

Parameters
fileName
considerWeights
inverseWeights
dropIsolates

◆ writeCentralityCloseness()

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

◆ writeCentralityClosenessInfluenceRange()

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

Writes the "improved" closeness centrality indices to a file.

Parameters
fileName
considerWeights
inverseWeights
dropIsolates

◆ writeCentralityDegree()

void Graph::writeCentralityDegree ( const QString fileName,
const bool considerWeights,
const bool dropIsolates )

Writes the Degree Centrality to a file.

Parameters
fileName
considerWeights
dropIsolates

◆ writeCentralityEccentricity()

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

Writes the Eccentricity centralities (aka Harary Graph Centrality) to a file.

Parameters
fileName
considerWeights
inverseWeights
dropIsolates

◆ writeCentralityEigenvector()

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

Writes the eigenvector centralities to a file.

Parameters
fileName
considerWeights
inverseWeights
dropIsolates

◆ writeCentralityInformation()

void Graph::writeCentralityInformation ( const QString fileName,
const bool considerWeights,
const bool inverseWeights )

Writes the information centralities to file.

Parameters
fileName
considerWeights
inverseWeights

◆ writeCentralityPower()

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

Writes Power Centralities to a file.

Parameters
fileName
considerWeights
inverseWeights
dropIsolates

◆ writeCentralityStress()

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

Writes the Stress centralities to a file.

Parameters
fileName
considerWeights
inverseWeights
dropIsolates

◆ writeCliqueCensus()

bool Graph::writeCliqueCensus ( const QString & fileName,
const bool considerWeights )

Graph::writeCliqueCensus Calls graphCliques() to compute all cliques (maximal connected subgraphs) of the network. Then writes the results into a file, along with the Actor by clique analysis, the Co-membership matrix and the Hierarchical clustering of overlap matrix.

Parameters
fileName
considerWeights

Write the actor by clique analysis matrix. For each actor-clique pair, we compute the proportion of clique members adjacent

Write the actor by actor analysis matrix. For each pair, we compute their clique co-membership

Write the Hierarchical clustering of overlap matrix

◆ writeClusteringCoefficient()

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

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

Parameters
fileName
considerWeights

◆ writeClusteringHierarchical()

bool Graph::writeClusteringHierarchical ( const QString & fileName,
const QString & varLocation,
const QString & matrix = "Adjacency",
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

◆ writeClusteringHierarchicalResultsToStream()

void Graph::writeClusteringHierarchicalResultsToStream ( QTextStream & outText,
const int N,
const bool & dendrogram = false )

Writes Hierarchical Clustering results to given output stream Before running this method, the method Graph::graphClusteringHierarchical() must execute and return true. Otherwise, the result is unpredictable...

Parameters
outText
N
dendrogram

◆ writeDataSetToFile()

void Graph::writeDataSetToFile ( const QString dir,
const QString fileName )

Writes a "famous" dataset to the given file Datasets are hardcoded! They are exported in the given fileName...

TODO: Move all these datasets to a separate class

Parameters
fileName

◆ writeEccentricity()

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

Writes the Eccentricity report to file.

Parameters
fileName
considerWeights
inverseWeights
dropIsolates

◆ writeMatrix()

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

◆ writeMatrixAdjacency()

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

Writes the adjacency matrix of G to a specified file fn

◆ writeMatrixAdjacencyInvert()

void Graph::writeMatrixAdjacencyInvert ( const QString & fn,
const QString & method )

Calls Graph::createMatrixAdjacencyInverse(method) to compute the inverse of the adjacency matrix and writes it to file fn in HTML notation.

Parameters
fn
method

◆ writeMatrixAdjacencyPlot()

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

Writes a visual representation of the adjacency matrix of the graph to the specified file.

The resulting matrix HAS NO spaces between elements.

Parameters
fn
simpler

◆ writeMatrixAdjacencyTo()

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

Exports the adjacency matrix to a given textstream

◆ writeMatrixDegreeText()

void Graph::writeMatrixDegreeText ( const QString & fn)

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

Parameters
fn

◆ writeMatrixDissimilarities()

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

◆ writeMatrixDistancesPlainText()

void Graph::writeMatrixDistancesPlainText ( const QString & fn,
const bool & considerWeights,
const bool & inverseWeights,
const bool & dropIsolates )

Writes the matrix of distances to a file.

Parameters
fn
considerWeights
inverseWeights
dropIsolates

◆ writeMatrixHTMLTable()

void Graph::writeMatrixHTMLTable ( QTextStream & outText,
Matrix & M,
const bool & markDiag = true,
const bool & plain = false,
const bool & printInfinity = true,
const bool & dropIsolates = false )

Writes the matrix M as HTML.

specified text stream outText It is the same as Matrix::printHTMLTable except that this method omits disabled vertices, thus the table header is correct

Parameters
outText
M
markDiag
plain
printInfinity

◆ writeMatrixLaplacianPlainText()

void Graph::writeMatrixLaplacianPlainText ( const QString & fn)

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

Parameters
fn

◆ writeMatrixShortestPathsPlainText()

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

Writes the shortest paths matrix to a file Each SIGMA(i,j) element is the number of shortest paths (geodesics) from i and j.

Parameters
fn
considerWeights
inverseWeights

◆ writeMatrixSimilarityMatching()

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

◆ writeMatrixSimilarityMatchingPlain()

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

◆ writeMatrixSimilarityPearson()

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

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

Parameters
fileName
considerWeights

◆ writeMatrixSimilarityPearsonPlainText()

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

◆ writeMatrixWalks()

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

◆ writePrestigeDegree()

void Graph::writePrestigeDegree ( const QString fileName,
const bool considerWeights,
const bool dropIsolates )

Writes the Degree Prestige of each node to a file.

Parameters
fileName
considerWeights
dropIsolates

◆ writePrestigePageRank()

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

Writes the PageRank scores of vertices to a file.

Parameters
fileName
dropIsolates

◆ writePrestigeProximity()

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

Writes the proximity prestige indices to a file.

Parameters
fileName
considerWeights
inverseWeights
dropIsolates

◆ writeReachabilityMatrixPlainText()

void Graph::writeReachabilityMatrixPlainText ( const QString & fn,
const bool & dropIsolates = false )

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

◆ writeReciprocity()

void Graph::writeReciprocity ( const QString fileName,
const bool considerWeights = false )

Writes reciprocity report to filename.

Parameters
fileName
considerWeights

◆ writeTriadCensus()

void Graph::writeTriadCensus ( const QString fileName,
const bool considerWeights )

◆ writeWalksOfLengthMatrixPlainText()

void Graph::writeWalksOfLengthMatrixPlainText ( const QString & fn,
const int & length )

◆ writeWalksTotalMatrixPlainText()

void Graph::writeWalksTotalMatrixPlainText ( const QString & fn)

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

Parameters
fn
netName
length

◆ DistanceEngine

friend class DistanceEngine
friend

Member Data Documentation

◆ actualDateTime

QDateTime Graph::actualDateTime
private

◆ AM

Matrix Graph::AM
private

◆ averageCLC

qreal Graph::averageCLC
private

◆ calculatedAdjacencyMatrix

bool Graph::calculatedAdjacencyMatrix
private

◆ calculatedCentralities

bool Graph::calculatedCentralities
private

◆ calculatedDC

bool Graph::calculatedDC
private

◆ calculatedDistances

bool Graph::calculatedDistances
private

◆ calculatedDP

bool Graph::calculatedDP
private

◆ calculatedEdges

bool Graph::calculatedEdges
private

◆ calculatedEVC

bool Graph::calculatedEVC
private

◆ calculatedGraphDensity

bool Graph::calculatedGraphDensity
private

◆ calculatedGraphReciprocity

bool Graph::calculatedGraphReciprocity
private

◆ calculatedGraphSymmetry

bool Graph::calculatedGraphSymmetry
private

◆ calculatedGraphWeighted

bool Graph::calculatedGraphWeighted
private

◆ calculatedIC

bool Graph::calculatedIC
private

◆ calculatedIRCC

bool Graph::calculatedIRCC
private

◆ calculatedIsolates

bool Graph::calculatedIsolates
private

◆ calculatedPP

bool Graph::calculatedPP
private

◆ calculatedPRP

bool Graph::calculatedPRP
private

◆ calculatedTriad

bool Graph::calculatedTriad
private

◆ calculatedVertices

bool Graph::calculatedVertices
private

◆ calculatedVerticesList

bool Graph::calculatedVerticesList
private

◆ calculatedVerticesSet

bool Graph::calculatedVerticesSet
private

◆ canvasHeight

qreal Graph::canvasHeight
private

◆ canvasWidth

qreal Graph::canvasWidth
private

◆ classesEC

int Graph::classesEC
private

◆ classesEccentricity

int Graph::classesEccentricity
private

◆ classesEVC

int Graph::classesEVC
private

◆ classesIC

int Graph::classesIC
private

◆ classesIRCC

int Graph::classesIRCC
private

◆ classesPP

int Graph::classesPP
private

◆ classesPRP

int Graph::classesPRP
private

◆ classesSBC

int Graph::classesSBC
private

◆ classesSCC

int Graph::classesSCC
private

◆ classesSDC

int Graph::classesSDC
private

◆ classesSDP

int Graph::classesSDP
private

◆ classesSPC

int Graph::classesSPC
private

◆ classesSSC

int Graph::classesSSC
private

◆ CLQM

Matrix Graph::CLQM
private

◆ csRecDepth

int Graph::csRecDepth
private

◆ d_factor

qreal Graph::d_factor
private

◆ denomEC

qreal Graph::denomEC
private

◆ denomEVC

qreal Graph::denomEVC
private

◆ denomIC

qreal Graph::denomIC
private

◆ denomIRCC

qreal Graph::denomIRCC
private

◆ denomPP

qreal Graph::denomPP
private

◆ denomPRC

qreal Graph::denomPRC
private

◆ denomSBC

qreal Graph::denomSBC
private

◆ denomSCC

qreal Graph::denomSCC
private

◆ denomSPC

qreal Graph::denomSPC
private

◆ discreteBCs

H_StrToInt Graph::discreteBCs
private

◆ discreteCCs

H_StrToInt Graph::discreteCCs
private

◆ discreteDPs

H_StrToInt Graph::discreteDPs
private

used in resolveClasses and graphDistancesGeodesic()

◆ discreteEccentricities

H_StrToInt Graph::discreteEccentricities
private

◆ discreteECs

H_StrToInt Graph::discreteECs
private

◆ discreteEVCs

H_StrToInt Graph::discreteEVCs
private

◆ discreteICs

H_StrToInt Graph::discreteICs
private

◆ discreteIRCCs

H_StrToInt Graph::discreteIRCCs
private

◆ discretePCs

H_StrToInt Graph::discretePCs
private

◆ discretePPs

H_StrToInt Graph::discretePPs
private

◆ discretePRPs

H_StrToInt Graph::discretePRPs
private

◆ discreteSCs

H_StrToInt Graph::discreteSCs
private

◆ discreteSDCs

H_StrToInt Graph::discreteSDCs
private

◆ DM

Matrix Graph::DM
private

◆ edgeReverseWeightTemp

qreal Graph::edgeReverseWeightTemp
private

◆ edgeWeightTemp

qreal Graph::edgeWeightTemp
private

◆ file_parser

Parser* Graph::file_parser
private

◆ file_parserThread

QThread Graph::file_parserThread
private

◆ groupCC

qreal Graph::groupCC
private

◆ groupDC

qreal Graph::groupDC
private

◆ groupDP

qreal Graph::groupDP
private

◆ groupEC

qreal Graph::groupEC
private

◆ groupEVC

qreal Graph::groupEVC
private

◆ groupIRCC

qreal Graph::groupIRCC
private

◆ groupPP

qreal Graph::groupPP
private

◆ groupSBC

qreal Graph::groupSBC
private

◆ groupSC

qreal Graph::groupSC
private

◆ groupSPC

qreal Graph::groupSPC
private

◆ htmlEnd

QString Graph::htmlEnd
private

◆ htmlHead

QString Graph::htmlHead
private

◆ htmlHeadLight

QString Graph::htmlHeadLight
private

◆ inboundEdgesVert

int Graph::inboundEdgesVert
private

◆ influenceDomains

QMultiHash<int, int> Graph::influenceDomains
private

◆ influenceRanges

QMultiHash<int, int> Graph::influenceRanges
private

◆ initEdgeColor

QString Graph::initEdgeColor
private

◆ initEdgeLabels

bool Graph::initEdgeLabels
private

◆ initEdgeWeightNumbers

bool Graph::initEdgeWeightNumbers
private

◆ initVertexColor

QString Graph::initVertexColor
private

◆ initVertexIconPath

QString Graph::initVertexIconPath
private

◆ initVertexLabelColor

QString Graph::initVertexLabelColor
private

◆ initVertexLabelDistance

int Graph::initVertexLabelDistance
private

◆ initVertexLabelSize

int Graph::initVertexLabelSize
private

◆ initVertexNumberColor

QString Graph::initVertexNumberColor
private

◆ initVertexNumberDistance

int Graph::initVertexNumberDistance
private

◆ initVertexNumberSize

int Graph::initVertexNumberSize
private

◆ initVertexShape

QString Graph::initVertexShape
private

◆ initVertexSize

int Graph::initVertexSize
private

◆ invAM

Matrix Graph::invAM
private

◆ invM

Matrix Graph::invM
private

◆ m_clickedEdge

MyEdge Graph::m_clickedEdge
private

◆ m_cliques

QMultiMap<int, L_int> Graph::m_cliques
private

◆ m_clusteringLevel

QList<qreal> Graph::m_clusteringLevel
private

◆ m_clusterPairNamesPerSeq

QMap<int, V_str> Graph::m_clusterPairNamesPerSeq
private

◆ m_clustersByName

QMap<QString, V_int> Graph::m_clustersByName
private

◆ m_clustersPerSequence

QMap<int, V_int> Graph::m_clustersPerSequence
private

◆ m_crawler_max_urls

int Graph::m_crawler_max_urls
private

◆ m_crawler_visited_urls

int Graph::m_crawler_visited_urls
private

◆ m_curRelation

int Graph::m_curRelation
private

◆ m_fieldWidth

int Graph::m_fieldWidth
private

◆ m_fileFormat

int Graph::m_fileFormat
private

◆ m_fileName

QString Graph::m_fileName
private

◆ m_graph

VList Graph::m_graph
private

◆ m_graphAverageDistance

qreal Graph::m_graphAverageDistance
private

◆ m_graphDensity

qreal Graph::m_graphDensity
private

◆ m_graphDiameter

int Graph::m_graphDiameter
private

◆ m_graphFileFormatExportSupported

QList<int> Graph::m_graphFileFormatExportSupported
private

◆ m_graphGeodesicsCount

qreal Graph::m_graphGeodesicsCount
private

◆ m_graphHasVertexCustomIcons

bool Graph::m_graphHasVertexCustomIcons
private

◆ m_graphIsConnected

bool Graph::m_graphIsConnected
private

◆ m_graphIsDirected

bool Graph::m_graphIsDirected
private

◆ m_graphIsSymmetric

bool Graph::m_graphIsSymmetric
private

◆ m_graphIsWeighted

bool Graph::m_graphIsWeighted
private

◆ m_graphModStatus

int Graph::m_graphModStatus
private

General & initialisation variables

◆ m_graphName

QString Graph::m_graphName
private

◆ m_graphReciprocityArc

qreal Graph::m_graphReciprocityArc
private

◆ m_graphReciprocityDyad

qreal Graph::m_graphReciprocityDyad
private

◆ m_graphReciprocityPairsReciprocated

int Graph::m_graphReciprocityPairsReciprocated
private

◆ m_graphReciprocityPairsTotal

int Graph::m_graphReciprocityPairsTotal
private

◆ m_graphReciprocityTiesNonSymmetric

int Graph::m_graphReciprocityTiesNonSymmetric
private

◆ m_graphReciprocityTiesReciprocated

int Graph::m_graphReciprocityTiesReciprocated
private

◆ m_graphReciprocityTiesTotal

int Graph::m_graphReciprocityTiesTotal
private

◆ m_graphSumDistance

qreal Graph::m_graphSumDistance
private

◆ m_relationsList

QList<QString> Graph::m_relationsList
private

◆ m_reportsChartType

ChartType Graph::m_reportsChartType
private

◆ m_reportsDataDir

QString Graph::m_reportsDataDir
private

◆ m_reportsLabelLength

int Graph::m_reportsLabelLength
private

◆ m_reportsRealPrecision

int Graph::m_reportsRealPrecision
private

◆ m_reserveEdgesPerVertexSize

int Graph::m_reserveEdgesPerVertexSize
private

◆ m_selectedEdges

QList<SelectedEdge> Graph::m_selectedEdges
private

◆ m_totalEdges

int Graph::m_totalEdges
private

◆ m_totalVertices

int Graph::m_totalVertices
private

◆ m_vertexClicked

int Graph::m_vertexClicked
private

◆ m_vertexPairsNotConnected

QMultiHash<int, int> Graph::m_vertexPairsNotConnected
private

◆ m_vertexPairsUnilaterallyConnected

QHash<int, int> Graph::m_vertexPairsUnilaterallyConnected
private

◆ m_verticesIsolatedList

QList<int> Graph::m_verticesIsolatedList
private

◆ m_verticesList

QList<int> Graph::m_verticesList
private

◆ m_verticesSelected

QList<int> Graph::m_verticesSelected
private

◆ m_verticesSet

QSet<int> Graph::m_verticesSet
private

◆ maxCLC

qreal Graph::maxCLC
private

◆ maxEC

qreal Graph::maxEC
private

◆ maxEccentricity

qreal Graph::maxEccentricity
private

◆ maxEVC

qreal Graph::maxEVC
private

◆ maxIC

qreal Graph::maxIC
private

◆ maxIndexBC

qreal Graph::maxIndexBC
private

◆ maxIndexCC

qreal Graph::maxIndexCC
private

◆ maxIndexEC

qreal Graph::maxIndexEC
private

◆ maxIndexIC

qreal Graph::maxIndexIC
private

◆ maxIndexPC

qreal Graph::maxIndexPC
private

◆ maxIndexSC

qreal Graph::maxIndexSC
private

◆ maxIRCC

qreal Graph::maxIRCC
private

◆ maxNodeCLC

int Graph::maxNodeCLC
private

◆ maxNodeDP

int Graph::maxNodeDP
private

◆ maxNodeEC

int Graph::maxNodeEC
private

◆ maxNodeEccentricity

int Graph::maxNodeEccentricity
private

◆ maxNodeEVC

int Graph::maxNodeEVC
private

◆ maxNodeIC

int Graph::maxNodeIC
private

◆ maxNodeIRCC

int Graph::maxNodeIRCC
private

◆ maxNodePP

int Graph::maxNodePP
private

◆ maxNodePRP

int Graph::maxNodePRP
private

◆ maxNodeSBC

int Graph::maxNodeSBC
private

◆ maxNodeSCC

int Graph::maxNodeSCC
private

◆ maxNodeSDC

int Graph::maxNodeSDC
private

◆ maxNodeSPC

int Graph::maxNodeSPC
private

◆ maxNodeSSC

int Graph::maxNodeSSC
private

◆ maxPP

qreal Graph::maxPP
private

◆ maxPRP

qreal Graph::maxPRP
private

◆ maxSBC

qreal Graph::maxSBC
private

◆ maxSCC

qreal Graph::maxSCC
private

◆ maxSDC

qreal Graph::maxSDC
private

◆ maxSDP

qreal Graph::maxSDP
private

◆ maxSPC

qreal Graph::maxSPC
private

◆ maxSSC

qreal Graph::maxSSC
private

◆ meanEC

qreal Graph::meanEC
private

◆ meanEVC

qreal Graph::meanEVC
private

◆ meanIC

qreal Graph::meanIC
private

◆ meanIRCC

qreal Graph::meanIRCC
private

◆ meanPP

qreal Graph::meanPP
private

◆ meanPRP

qreal Graph::meanPRP
private

◆ meanSBC

qreal Graph::meanSBC
private

◆ meanSCC

qreal Graph::meanSCC
private

◆ meanSDC

qreal Graph::meanSDC
private

◆ meanSDP

qreal Graph::meanSDP
private

◆ meanSPC

qreal Graph::meanSPC
private

◆ meanSSC

qreal Graph::meanSSC
private

◆ minCLC

qreal Graph::minCLC
private

◆ minEC

qreal Graph::minEC
private

◆ minEccentricity

qreal Graph::minEccentricity
private

◆ minEVC

qreal Graph::minEVC
private

◆ minIC

qreal Graph::minIC
private

◆ minIRCC

qreal Graph::minIRCC
private

◆ minNodeCLC

int Graph::minNodeCLC
private

◆ minNodeDP

int Graph::minNodeDP
private

◆ minNodeEC

int Graph::minNodeEC
private

◆ minNodeEccentricity

int Graph::minNodeEccentricity
private

◆ minNodeEVC

int Graph::minNodeEVC
private

◆ minNodeIC

int Graph::minNodeIC
private

◆ minNodeIRCC

int Graph::minNodeIRCC
private

◆ minNodePP

int Graph::minNodePP
private

◆ minNodePRP

int Graph::minNodePRP
private

◆ minNodeSBC

int Graph::minNodeSBC
private

◆ minNodeSCC

int Graph::minNodeSCC
private

◆ minNodeSDC

int Graph::minNodeSDC
private

◆ minNodeSPC

int Graph::minNodeSPC
private

◆ minNodeSSC

int Graph::minNodeSSC
private

◆ minPP

qreal Graph::minPP
private

◆ minPRP

qreal Graph::minPRP
private

◆ minSBC

qreal Graph::minSBC
private

◆ minSCC

qreal Graph::minSCC
private

◆ minSDC

qreal Graph::minSDC
private

◆ minSDP

qreal Graph::minSDP
private

◆ minSPC

qreal Graph::minSPC
private

◆ minSSC

qreal Graph::minSSC
private

◆ neighboursHash

QHash<int, QSet<int> > Graph::neighboursHash
private

◆ nomEC

qreal Graph::nomEC
private

◆ nomEVC

qreal Graph::nomEVC
private

◆ nomIC

qreal Graph::nomIC
private

◆ nomIRCC

qreal Graph::nomIRCC
private

◆ nomPP

qreal Graph::nomPP
private

◆ nomPRC

qreal Graph::nomPRC
private

◆ nomSBC

qreal Graph::nomSBC
private

◆ nomSCC

qreal Graph::nomSCC
private

◆ nomSPC

qreal Graph::nomSPC
private

◆ order

bool Graph::order
private

◆ outboundEdgesVert

int Graph::outboundEdgesVert
private

◆ reciprocalEdgesVert

int Graph::reciprocalEdgesVert
private

◆ SIGMA

Matrix Graph::SIGMA
private

◆ sizeOfComponent

qreal Graph::sizeOfComponent
private

◆ sizeOfNthOrderNeighborhood

H_f_i Graph::sizeOfNthOrderNeighborhood

◆ Stack

stack<int> Graph::Stack
private

◆ sumBC

qreal Graph::sumBC
private

◆ sumCC

qreal Graph::sumCC
private

◆ sumDC

qreal Graph::sumDC
private

◆ sumDP

qreal Graph::sumDP
private

◆ sumEC

qreal Graph::sumEC
private

◆ sumEVC

qreal Graph::sumEVC
private

◆ sumIC

qreal Graph::sumIC
private

◆ sumIRCC

qreal Graph::sumIRCC
private

◆ sumM

Matrix Graph::sumM
private

◆ sumPC

qreal Graph::sumPC
private

◆ sumPP

qreal Graph::sumPP
private

◆ sumPRP

qreal Graph::sumPRP
private

◆ sumSBC

qreal Graph::sumSBC
private

◆ sumSC

qreal Graph::sumSC
private

◆ sumSCC

qreal Graph::sumSCC
private

◆ sumSDC

qreal Graph::sumSDC
private

◆ sumSDP

qreal Graph::sumSDP
private

◆ sumSEVC

qreal Graph::sumSEVC
private

◆ sumSPC

qreal Graph::sumSPC
private

◆ sumSSC

qreal Graph::sumSSC
private

◆ t_sumIC

qreal Graph::t_sumIC
private

◆ t_sumPRP

qreal Graph::t_sumPRP
private

◆ triadTypeFreqs

QList<int> Graph::triadTypeFreqs
private

◆ urlQueue

QQueue<QUrl>* Graph::urlQueue
private

◆ varianceCLC

qreal Graph::varianceCLC
private

◆ varianceEC

qreal Graph::varianceEC
private

◆ varianceEVC

qreal Graph::varianceEVC
private

◆ varianceIC

qreal Graph::varianceIC
private

◆ varianceIRCC

qreal Graph::varianceIRCC
private

◆ variancePP

qreal Graph::variancePP
private

◆ variancePRP

qreal Graph::variancePRP
private

◆ varianceSBC

qreal Graph::varianceSBC
private

◆ varianceSCC

qreal Graph::varianceSCC
private

◆ varianceSDC

qreal Graph::varianceSDC
private

◆ varianceSDP

qreal Graph::varianceSDP
private

◆ varianceSPC

qreal Graph::varianceSPC
private

◆ varianceSSC

qreal Graph::varianceSSC
private

◆ vpos

H_Int Graph::vpos

vpos 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

◆ web_crawler

WebCrawler* Graph::web_crawler
private

◆ webcrawlerThread

QThread Graph::webcrawlerThread
private

◆ WM

Matrix Graph::WM
private

◆ XM

Matrix Graph::XM
private

◆ XRM

Matrix Graph::XRM
private

◆ XSM

Matrix Graph::XSM
private

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