Code covered by the BSD License  

Highlights from
Matgraph

from Matgraph by Ed Scheinerman
Toolbox for working with simple, undirected graphs

Description of deg
Home > matgraph > @graph > deg.m

deg

PURPOSE ^

deg: degree of a vertex or degree sequence

SYNOPSIS ^

function d = deg(g,v)

DESCRIPTION ^

 deg: degree of a vertex or degree sequence
 deg(g) --- degree sequence of g
 deg(g,v) --- degree of v in g

CROSS-REFERENCE INFORMATION ^

This function calls:
  • full full(g) --- convert internal storage for g to full
This function is called by:
  • color color(g,algo) --- color the graph g by a given algorithm
  • euler_trail euler_trail(g) --- find an euler trail in g (if one exists)
  • iso [yn,p] = iso(g,h,options) --- is g isomorphic to h?
  • laplacian laplacian(g) --- get the Laplacian matrix of g
  • nsptrees nsptrees(g) --- number of spanning trees of g.
  • prufer prufer --- convert a tree to/from its Prufer code
  • selective selective(g,n,n0,d) --- selective attachment random graph
  • trim trim(g,d) --- iteratively remove vertices of degree at most d
  • vertex_degree_sequence find the degrees of the neighbors of a vertex

SOURCE CODE ^

0001 function d = deg(g,v) 
0002 % deg: degree of a vertex or degree sequence
0003 % deg(g) --- degree sequence of g
0004 % deg(g,v) --- degree of v in g
0005 
0006 global GRAPH_MAGIC
0007 
0008 
0009 if (nargin==1)
0010     d = full(sum(GRAPH_MAGIC.graphs{g.idx}.array));
0011 else
0012     d = full(sum(GRAPH_MAGIC.graphs{g.idx}.array(v,:)));
0013 end

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

Contact us at files@mathworks.com