@graph

Status: Work in progess. All scripts have a nice help, but that is the extent of the documentation.

Download: [tar file]

MATLAB graph class. It allows you to create, draw, and perform a few simple operations on graphs. So far very few operations are supported, but it is already pretty useful to create all sorts of regular graphs.

The following command is used to create a graph.:

%function g = graph(varargin)

% This function creates a new object of class graph

%

% Object properties

%    .vertices   array of vertices (one per row). Used as coordinates

%                for ploting

%    .edges      (sparse) adjacency matrix (edges from column to row node)

%

% Initialization commands

% graph('empty',vertices)      - creates a graph with no edges

% graph('eye',vertices)        - creates a graph whose only edges are from

%                                a node to itself

% graph('full',vertices)       - creates a fully connected graph

% graph('1d-lattice',vertices) - creates a bidirectional 1d-lattice where each

%                                vertex is connected to the next one

% graph('1d-unilattice',vertices) - creates a unidirectional 1d-lattice where

%                                each vertex is connected to the next one

% graph('2d-deg4-reclattice',{x-vertices,y-vertices}) - creates a bidirectional

%                                2d-lattice with rectangular cells (degree 4)

% graph('2d-deg3-hexlattice',{width,height,scale}) - creates a bidirectional

%                                2d-lattice with hexagonal cells and

%                                degree 3 nodes

% graph('2d-deg6-trilattice',{width,height,scale}) - creates a bidirectional

%                                2d-lattice with triangular cells and

%                                degree 6 nodes

% graph('delaunay',vertices)   - creates a bidirectional delaunay graph for the

%                                given vertex coordinates

% graph('2image-affine-transf',image-size,transformation-matrix) - creates

%                                the graph associates with a given affine

%                                transformation for a 2d image, the vertices

%                                are the image coordinates of the pixels

%

% Copyright (C) 2004  Joao Hespanha

The following figure shows the output of the demo script ‘demo_graph.m’, which is included to illustrate the creation of several graphs.

More examples are available in the page of the graph partitioning algorithm grPartition.

Bibliographic citation

When used in research, please acknowledge the use of this software with the following reference:

João Hespanha. @graph — a MATLAB class for graph computations. Available at http://www.ece.ucsb.edu/~hespanha, Oct. 2004.

or if you use latex/bibtex:

@Misc{HespanhaOct04,

  key =          {software},

  author =       {Jo{\~a}o Pedro Hespanha},

  title =        {\texttt{@graph} a {MATLAB} class for graph computations},

  howpublished = {Available at \url{http://www.ece.ucsb.edu/~hespanha}},

  month =        oct,

  year =          2004

}

Disclaimer

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details (http://www.gnu.org/copyleft/gpl.html)