Code covered by the BSD License  

Highlights from
Matgraph

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

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

is_labeled

PURPOSE ^

is_labeled(g) --- determine if there are labels on vertices.

SYNOPSIS ^

function yn = is_labeled(g)

DESCRIPTION ^

 is_labeled(g) --- determine if there are labels on vertices.
 By definition, an empty graph is NOT labeled.

CROSS-REFERENCE INFORMATION ^

This function calls:
This function is called by:
  • bfstree bfstree(t,g,v) --- create a breadth-first spanning tree of g
  • cartesian cartesian(g,h1,h2) --- overwrite g with the product of h1 and h2
  • 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
  • dot dot(g,filename) --- save graph for use by graphviz.
  • draw_labels draw_labels(g) --- add labels to a drawing of g
  • get_label get_label(g) or get_label(g,v) --- get vertex label(s)
  • induce induce --- create induced subgraphs
  • label Assign labels to vertices of g
  • ldraw ldraw(g,line_style) --- draw a graph with vertices marked with their labels
  • renumber renumber the vertices of a graph
  • resize resize(g,n) --- change the number of vertices in g to n
  • save save(g,filename) --- save a graph to disk

SOURCE CODE ^

0001 function yn = is_labeled(g)
0002 % is_labeled(g) --- determine if there are labels on vertices.
0003 % By definition, an empty graph is NOT labeled.
0004 
0005 global GRAPH_MAGIC
0006 
0007 if (isfield(GRAPH_MAGIC.graphs{g.idx},'labels'))
0008     yn = length(GRAPH_MAGIC.graphs{g.idx}.labels) > 0;
0009 else
0010     yn = false;
0011 end

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

Contact us at files@mathworks.com