Package for manipulate graphs represented as well as adjacent matrix or adjacent list. The common format of representation adopted for the graphs files is : number_of_edges on the first line, and then vertice_i \t vertice_j on the other one.
This is the list of the differents functions implemented in this library.
Compute the number of vertices in a graph
Compute the number of edges in a graph
SYNOPSIS $N=edges_nb(representation, graph)
OUTPUT The number of edges in the graph
Compute the mean number of a table excluding the null values
the hash table
OUTPUT The mean number of the table
Computing of the global density of a graph
SYNOPSIS $d=densite(representation, graph)
OUTPUT The density of the graph. (Usefull with the graph with multiple connected components)
Compute the degree of each vertex
SYNOPSIS %D=degree(representation, graph)
OUTPUT The hash table of each vertice's degree
Compute the cluster coefficient of a graph
SYNOPSIS $C=cluster_coeff(representation, graph)
OUTPUT Computing of the clustering coefficient defined by Watts and Strogatz ("Collective dynamics of 'small-world' networks", Nature, 393, 440-442 (1998)). Taking two neigbours vertices, this is the probability that a third vertex exists which is neigbour to the two others. C=(Number of neighbours vertices with a third neighbour vertex to the two others)/(Number of neighbour vertices = number of edges)
Compute the sortest paths in a graph from a given starting vertex
SYNOPSIS %PCC=shortest_paths(representation, start, graph)
OUTPUT Computing of the list of the shortest paths from a start vertex in a graph using the Dijkstra's algorithm.
Compute the number of triangles in which a given edge is implicated
SYNOPSIS %D=triangle_nb(representation, start_vertex, end_vertex, graph)
OUTPUT The number of triangles in wich the given edge is implicated.
Compute a specific distance between vertices of the graph (distances are Dice, Radicchi, ...)
SYNOPSIS %D=distance(representation, distance, graph)
the type of representation choosen : 1 = adjacent matrix, and 2 = adjacent list
a type of distance in :
the betweeness of an edge is the number of shortest paths which going through this edge ; a definition is given by Girvan and Newman in "Community structure in social and biological networks", Proc. Natl. Acad. Sci. USA, 99, 7821-7826 (2002)
for an edge (i,j), the distance d(i,j) is (nb of triangles in which (i,j) is implicated + 1)/min(degree(i)-1, degree(j)-1). see F. Radicchi, C. Castellano, F. Cecconi, V. Loreto and D. Parisi, "Defining and identifying communities in networks", preprint condmat/0309263 (2003)
All these distances are conform to the specification given previsiously
the hash table of the graph
OUTPUT The table of the distance choosen. Note that the value '32767' indicate infinite distance.
Computing of the internal density of a cluster of a graph
SYNOPSIS $d=internal_density(representation, cluster, graph)
OUTPUT The internal density of the given cluster of the graph.
Computing of the external density of a graph
SYNOPSIS $d=external_density(representation, nb_cluster, ref_cluster, graph)
OUTPUT The external density of the graph.
Computing of the maximal distance of a graph
hash table of the distances
OUTPUT The maximal distance.
Convert a list of edges distances in vertices densities
SYNOPSIS %Dens=distance2density(representation, ref_distances, graph)
OUTPUT The list of the densities of each vertex.
Convert a list of vertices densities in edges densities
SYNOPSIS %Distance=edge_density(representation, ref_densities, graph)
OUTPUT The list of the densities for each edge (expressed as a distance)
Graph::Calculs is Copyright (C) 2004, Tristan Colombo CNRS - LCB, 31 chemin Joseph Aiguier 13009 Marseille France Email: firstname.lastname@example.org All rights reserved. You may distribute this package under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.