Home > matgraph > @graph > neighbors.m

neighbors

PURPOSE ^

neighbors(g,v) --- neighbors of v as a list.

SYNOPSIS ^

function nlist = neighbors(g,v)

DESCRIPTION ^

 neighbors(g,v) --- neighbors of v as a list.
 Note: invoking g(v) has the same effect.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function nlist = neighbors(g,v)
0002 % neighbors(g,v) --- neighbors of v as a list.
0003 % Note: invoking g(v) has the same effect.
0004 
0005 global GRAPH_MAGIC
0006 
0007 n = nv(g);
0008 if (v<0) | (v>n)
0009     nlist = [];
0010 else
0011     nlist = find(GRAPH_MAGIC.graphs{g.idx}.array(v,:));
0012 end

Generated on Thu 13-Mar-2008 14:23:52 by m2html © 2003