Skip to content

DEPRECATED teexGraph Listener

franktakes edited this page Nov 14, 2021 · 1 revision

This page describes the functionality of the listener option in teexGraph.

Installation

The regular executable of teexGraph merely executes precompiled C++ code. To use the listener, instead of just typing make, compile the project using:

make listener

This will create an executable teexgraph that will execute commands and queries presented as standard input from the command line.

Usage (input and output)

Apart from giving commands via keyboard input, it is of course also possible to input commands through a file via input/output redirection. For example, if one has a file name input.txt containing

load_undirected edgelist.tsv
nodes 
edges
wcc_density

By running

./teexgraph < input.txt > output.txt

The file edgelist.tsv is (silently) loaded after which output.txt will contain the values of the three requested metrics:

2590 
19306
0.00287912

Any log messages or errors in executing the given commands are written to respectively standard log (clog) and standard error (cerror).

Commands

Commands can be preceded by scc_ or wcc_ to indicate that they should be applied to the largest strongly connected component (directed graphs) or the largest weakly connected component (directed and undirected graphs). If omitted, the metrics are computed on the entire network.

Some commands have parameters; in such cases this parameter is expected to be of the correct type. Here the teexGraph listener expects friendly input; faulty parameter types can cause unexpected behavior.

The output of a command can be:

  • A single value of type int or double.
  • An output of the form distri; a list of pairs 'value frequency' separated by whitespace.
  • An output of the form nodelist; a list of nodes separated by whitespace.
  • An output of the form nodevals; a list of pairs 'nodeID value' separated by whitespace.

Binary output

Larger output, such as those of type nodelist and nodevals can optionally be outputted to a file instead of standard output. The output filename can be set and unset as follows:

Command Output Description Parameters
set_binay_file_output None after executing this command, all outpts of type nodevals and nodelist will be in binary to 'filename' (and the rest to standard output). give 0 as filename parameter to revert to standard output 1: filename: string

Parameters

Sometimes, parameters should be added, separated from the preceding command and from eachother by whitespace.

The parameter is of a particular type:

  • string: alphanumeric characters and punctuation, but no whitespace
  • int: an integer (or long integer)
  • double a number with decimals
  • double a number with decimals

Overview of commands

The following commands are applicable to full network or the largest weakly (prepend wcc_) or strongly (prepend scc_) connected component:

Command Output Description Parameters
load_directed None load a directed network from the edgelist provided in the file named 'filename' 1: filename: string
load_undirected None load an undirected network from the edgelist provided in the file named 'filename' 1: filename: string
nodes int number of nodes None
edges int number of edges None
selfedges int number of self-loops None
density double fraction of edges compared to the maximum number of edges None
reciprocity double fraction of links that is symmetric (in a directed network) None
averagedegree double average number of (outgoing) connections averaged over all nodes None
graph_clustering double graph clustering coefficient, i.e., the percentage of closed triangles None
avg_local_clustering double average local clustering coefficient, i.e., the average of the percentage of closed triangles among the neighbors of a node, averaged over all nodes None
distance int computes the distance from node 'source' to node 'target' 2: source: int and target: int
distances nodevals compute the distance from node 'source' to all other nodes 1: source: int
dist_distri distri frequency of pairwise node-to-node distances, from the count of nodes at distance '0' (this count is equal to node count) to the frequency of nodes at maximal distance 'diameter' (this count is equal to the periphery size) None
est_dist_distri distri frequency of pairwise node-to-node distances (like 'dist_distri'), but now with a parameter 'samplesize' that can be set to a value between 0 and 1 to indicate the percentage of nodes to be sampled, or to a value greater than 1 to indicate that exactly that many nodes need to be sampled 1: sample size: double
wccsize_distri distri distribution of the sizes of the weakly connected components None
sccsize_distri distri distribution of the sizes of the weakly connected components None
deg_distri distri distribution of the node degrees None
local_clustering nodevals average local clustering coefficient of each node None
outdegree_centrality nodevals outdegree centrality value of each node None
indegree_centrality nodevals indegree centrality value of each node None

These metrics will automatically be applied to the largest (weakly) connected component of the network:

Command Output Description Parameters
diameter int maximal distance, i.e., length of a longest shortest path, i.e. maximal eccentricity over all nodes (undirected graphs only) None
radius int minimal eccentricity over all nodes (undirected graphs only) None
periphery int number of nodes with eccentricity equal to diameter (undirected graphs only) None
center int number of nodes with eccentricity equal to radius (undirected graphs only) None
eccentricity_distri distri distribution of the node eccentricity values None

The following metrics can only be applied to the full network or the largest (weakly) connected component of the network:

Command Output Description Parameters
eccentricity_centrality nodevals eccentricity centrality value of each node None
closeness_centrality nodevals closeness centrality value of each node None
betweenness_centrality nodevals closeness centrality value of each node None
est_closeness_centrality nodevals estimated closeness centrality value of each node. if the parameter p is 0 < p <= 1 then a p*100 percent random sample is used, if 1 < p > n then that many samples are used 1: sample size p: double
est_betweenness_centrality nodevals esimated betweenness centrality value of each node. if the parameter p is 0 < p <= 1 then a p*100 percent random sample is used, if 1 < p > n then that many samples are used 1: sample size p: double

Clone this wiki locally