Code covered by the BSD License  

Highlights from
Matgraph

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

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

nv

PURPOSE ^

nv(g) --- number of vertices in g

SYNOPSIS ^

function n = nv(g)

DESCRIPTION ^

 nv(g) --- number of vertices in g

CROSS-REFERENCE INFORMATION ^

This function calls:
This function is called by:
  • across across(g,X,Y) --- find all edges with one end in X and other end in Y.
  • add add --- add edge(s) to the graph
  • bfstree bfstree(t,g,v) --- create a breadth-first spanning tree of g
  • bipartition part = bipartition(g) --- find bipartition of a bipartite graph
  • bipmatch bipmatch --- maximum matching in a bipartite graph
  • cartesian cartesian(g,h1,h2) --- overwrite g with the product of h1 and h2
  • cayley cayley(g,perms) -- create a Cayley graph (undirected)
  • cdraw cdraw(g,coloring) -- draw g with a given vertex coloring
  • clear_edges clear_edges(g) --- delete all edges of g
  • color color(g,algo) --- color the graph g by a given algorithm
  • complement graph complement
  • complete complete: build complete and complete multipartite graphs
  • component component(g,v) -- find vertices in v's component of g
  • components components(g) --- find the components of the graph g
  • contract contract(g,u,v) --- contract v into u
  • copy_labels copy_labels(g,h) --- copy labels from h to g
  • delete delete --- delete vertices or edges from a graph
  • dfstree dfstree(t,g,v) --- create a depth-first spanning tree of g
  • disjoint_union disjoint_union(g,h,k) --- overwrite g with the disjoint union of the
  • display display(g) --- display basic information about a graph object
  • dist dist(g,v,w) and dist(g,v) --- find distance(s) between vertices
  • distxy distxy(g) -- give g a distance based embedding
  • dom [d,S] = dom(g) --- domination number of g
  • dot dot(g,filename) --- save graph for use by graphviz.
  • draw draw(g) --- draw g in a figure window
  • draw_labels draw_labels(g) --- add labels to a drawing of g
  • embed embed --- create an embedding for a graph
  • euler_trail euler_trail(g) --- find an euler trail in g (if one exists)
  • find_path find_path(g,u,v) --- find a shortest path from u to v
  • graffle graffle(g, filename, width, rad) --- write graph in OmniGraffle format
  • hamiltonian_cycle hamiltonian_cycle(g) --- find a Hamiltonian cycle in g (if one exists)
  • has has --- check if the graph has a particular vertex or edge
  • has_path has_path(g,u,v) --- determine if there is a path from u to v in g
  • hasxy hasxy(g) --- determine if an embedding has been created for g
  • intersect intersect(g,h1,h2) --- g is set to the intersection of h1 and h2.
  • isconnected isconnected(g) --- test if g is a connected graph
  • iso [yn,p] = iso(g,h,options) --- is g isomorphic to h?
  • join join(g,h1,h2) --- overwrite g with the join of h1 and h2
  • label Assign labels to vertices of g
  • laplacian laplacian(g) --- get the Laplacian matrix of g
  • load load(g,filename) --- read a saved graph on disk
  • match_join match_join(g,h1,h2) --- overwrite g with a graph formed from disjoint
  • mdsxy mdsxy(g) -- create an embedding based on multidimensional scaling
  • nauty nauty(g,filename) -- save a graph in nauty format
  • ndraw ndraw(g) --- draw g in a figure window with numbered vertices
  • neighbors neighbors(g,v) --- neighbors of v as a list.
  • nsptrees nsptrees(g) --- number of spanning trees of g.
  • prufer prufer --- convert a tree to/from its Prufer code
  • random random --- overwrite g with a random graph
  • randxy randxy(g) --- give g a random embedding in the plane
  • renumber renumber the vertices of a graph
  • resistance R = resistance(g) --- calculate resistances between vertices
  • resize resize(g,n) --- change the number of vertices in g to n
  • 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
  • springxy springxy(g) --- find a spring embedding of g
  • subsref subsref implements the notation g(v) and g(v,w)
  • trim trim(g,d) --- iteratively remove vertices of degree at most d
  • union union(g,h1,h2) --- set g equal to the union of h1 and h2.
  • wheel wheel(g,n) --- overwrite g with a wheel graph on n vertices

SOURCE CODE ^

0001 function n = nv(g) 
0002 % nv(g) --- number of vertices in g
0003 
0004 global GRAPH_MAGIC
0005 n = length(GRAPH_MAGIC.graphs{g.idx}.array);

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

Contact us at files@mathworks.com