TextGraphics.Analysis package

Submodules

TextGraphics.Analysis.communityDetection module

TextGraphics.Analysis.plotting module

class TextGraphics.Analysis.plotting.Pictures(graph)[source]

Analyzing the graph by using drawings.

Arguments:
graph - a networkx graph or digraph.
betweennessPlot()[source]

Plot the betweenness centrality of the nodes.

closenessPlot()[source]

Plot the closeness centrality of the nodes.

degreePlot()[source]

Plot the degrees of the nodes.

graphPlot(threshold, labelingByNumbers=False)[source]

Plot of the (weighted) graph.

Arguments:
threshold - a value of the weight threshold to separate
strong edges from weak ones.
Returns:
a matplotlib plot of the graph.

TextGraphics.Analysis.properties module

class TextGraphics.Analysis.properties.Analysis(graph)[source]

Some important properties of the graph.

Arguments:
graph - A networkx graph or digraph.
ConnectedComponents()[source]

Compute the connected components of the graph.

Returns:
a list containing lists of nodes in each connected components.
centralNodes(nNodes, closeness=False, betweenness=False)[source]

Compute the most central nodes. It measure how important/central in the graph a node is. We have three metrics for measuring centrality —

Degree Centrality : The degree centrality for a node v is the fraction of nodes it is connected to.
This is the default measure.
Closeness Centrality : Closeness centrality of a node u is the reciprocal of the sum of the
shortest path distances from u to all n−1 other nodes. (http://en.wikipedia.org/wiki/Centrality#Closeness_centrality)
Betweenness Centrality : Betweenness centrality of a node v is the sum of the fraction of all-pairs
shortest paths that pass through v. (http://en.wikipedia.org/wiki/Betweenness_centrality)
Arguments:
nNodes - number of most central nodes to be retrieved. closeness : If True, the closeness centrality is evaluated. betweenness : If True, the betweenness centrality is evaluated.
Returns:
A list of most central nodes.
nodeInConnectedComponent(node)[source]

Place a node in a connected component of the graph.

Arguments:
node - the node whose connected component is desired.
Returns:
A connected subgraph of the original graph which contains the node.

Module contents