Paul Kump's Original Matlab Code

Networks

adjacencyMatrix.m - Calculates the adjacency matrix for an input list of graph edges. The graph edges may be weighted or unweighted, directed or undirected. For m unique nodes, the output matrix is a sparse m by m matrix whose nonzero entries are taken from the input weights. Emphasis on efficiency for large datasets. No for loops are used. Written by Paul Kump for Illinois Institute of Technology and the Chicago Police Department.

degreeSeparation.m - Find the shortest distance between all pairs of nodes in a graph given the graph's adjacency matrix. Edges may be directed or undirected but must be unweighted. For m unique nodes, the output is an m by m sparse matrix whose nonzero entries indicate the shortest distance between nodes i and j. Emphasis on efficiency for large datasets. No for loops are used. Written by Paul Kump for Illinois Institute of Technology and the Chicago Police Department. Requires mpower2.m.

timeOfLink.m - Gives the first time index that two nodes in a time-evolving graph establish a connection. The graph may be directed or undirected, weighted or unweighted. Works in conjunction with adjacencyMatrix.m and degreeSeparation.m. Though degreeSeparation.m should not be used with a weighted graph, its output for a weighted graph can still be used as the input to timeOfLink.m for accurate results. This is because timeOfLink.m looks for when a matrix element becomes non-zero, but the magnitude does not matter. Written by Paul Kump for Illinois Institute of Technology and the Chicago Police Department.

neighborNodes.m - Find all the neighbors of a given node in a directed or undirected graph given the graph's adjacnecy matrix. Given a query node, this slick function finds all the degree-one neighbors and sets them as the new query nodes and recursively calls itself until the user-defined neighbor threshold is reached. Written by Paul Kump for Illinois Institute of Technology and the Chicago Police Department.

networkCliques.m - Analysis of the cliques and graph stucture of any undirected graph. A clique is defined as a group of nodes such that every edge of every node in the group begins and ends with a node in the same group. The output is a data structure with fields: number of nodes, number of edges, maximum separation, number of one-node cliques, cliques (a cell array where the ith component is a vector of all nodes in the ith clique), number of cliques, average clique size, largest clique, smallest clique. Written by Paul Kump for Illinois Institute of Technology and the Chicago Police Department.