Code covered by the BSD License  

Highlights from
Matgraph

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

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

randxy

PURPOSE ^

randxy(g) --- give g a random embedding in the plane

SYNOPSIS ^

function randxy(g)

DESCRIPTION ^

 randxy(g) --- give g a random embedding in the plane

CROSS-REFERENCE INFORMATION ^

This function calls:
  • embed embed --- create an embedding for a graph
  • nv nv(g) --- number of vertices in g
This function is called by:

SOURCE CODE ^

0001 function randxy(g)
0002 % randxy(g) --- give g a random embedding in the plane
0003 
0004 n = nv(g);
0005 xy = sqrt(n)*randn(n,2)/2;
0006 embed(g,xy);

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

Contact us at files@mathworks.com