# MIT Strategic Engineering ## Matlab Tools for Network Analysis (2006-2011)

This toolbox was first written in 2006. The last version, posted here, is from November 2011. These routines are useful for someone who wants to start hands-on work with networks fairly quickly, explore simple graph statistics, distributions, simple visualization and compute common network theory metrics. The code is not object-oriented, and should be easy to use, read and improve upon. There is some overlap with the grTheory toolbox and the MatlabBGL library published on Matlab Central. Different authorship is indicated in the header. No code is perfect so please contact gergana at alum dot mit.edu if you notice errors or have pointers to better routines.

### Current version

The new and current version of this code is available in Octave (GNU Octave Version 3.4.0 and Gnuplot 4.2.5) here. Some parts of the code are restructured and updated. All functions are generally better documented. The Octave toolbox also includes a manual with background information and examples.

### Archived Version (frozen Nov. 2011)

The code is classified by functionality as follows (121 routines total, last version Nov 6, 2011). All functions can be downloaded here.

#### Basic network routines (17)

• getNodes.m - return the list of nodes for varying graph representations;
• getEdges.m - return the list of edges for varying graph representations;
• numnodes.m - number of vertices/nodes in the network;
• numedges.m - number of edges/links in the network;
• selfloops.m - number of selfloops, i.e. nodes connected to themselves;
• multiedges.m - number of arcs (i,j) with multiple edges across them;
• average_degree.m - the average degree (# links) across all nodes;
• num_conn_comp.m - number of connected components (using algebraic connectivity);
• find_conn_comp.m - the number of connected components in an undirected graph;
• giant_component.m - extract the giant component only (undirected graph);
• tarjan.m - find the strongly connected components in a directed graph;
• graph_complement.m - the complement graph;
• graph_dual.m - the graph dual (or line graph, adjoint graph);
• subgraph.m - return the subgraph adjacency given the graph and the subgraph nodes;
• leaf_nodes.m - nodes connected to only one other node;
• leaf_edges.m - edges with only one adjacent edge;