Code covered by the BSD License  

Highlights from
Matgraph

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

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

ne

PURPOSE ^

ne(g) --- number of edges in g or ne(g,h) --- check for inequality

SYNOPSIS ^

function m = ne(g,h)

DESCRIPTION ^

 ne(g) --- number of edges in g or ne(g,h) --- check for inequality

CROSS-REFERENCE INFORMATION ^

This function calls:
  • size size(g) --- returns [nv,ne] for the graph
This function is called by:
  • bipartition part = bipartition(g) --- find bipartition of a bipartite graph
  • bridges bridges(g,algo) --- find all cut edges in g
  • cdraw cdraw(g,coloring) -- draw g with a given vertex coloring
  • display display(g) --- display basic information about a graph object
  • dot dot(g,filename) --- save graph for use by graphviz.
  • draw draw(g) --- draw g in a figure window
  • euler_trail euler_trail(g) --- find an euler trail in g (if one exists)
  • graffle graffle(g, filename, width, rad) --- write graph in OmniGraffle format
  • prufer prufer --- convert a tree to/from its Prufer code
  • random_regular random_regular(g,n,k) --- create a random regular graph
  • save save(g,filename) --- save a graph to disk
  • sgf sgf --- simple graph format: a 2-column matrix representation
  • size size(g) --- returns [nv,ne] for the graph

SOURCE CODE ^

0001 function m = ne(g,h)
0002 % ne(g) --- number of edges in g or ne(g,h) --- check for inequality
0003 
0004 global GRAPH_MAGIC
0005 
0006 if (nargin == 2)
0007     if any(size(g) ~= size(h))
0008         m = 1;
0009         return
0010     end
0011     D = GRAPH_MAGIC.graphs{g.idx}.array - GRAPH_MAGIC.graphs{h.idx}.array;
0012     m = nnz(D)>0;
0013     return
0014 end
0015 
0016 m = nnz(GRAPH_MAGIC.graphs{g.idx}.array)/2;

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

Contact us at files@mathworks.com