31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

void<br />

random planar graph(graph& G, node array& xcoord,<br />

node array& ycoord, int n)<br />

creates a random planar graph G with n nodes embedded<br />

into the unit sqare. <strong>The</strong> embedding is given by<br />

xcoord[v] and ycoord[v] for every node v of G. <strong>The</strong><br />

generator chooses n segments whose endpoints have<br />

random coordinates of the form x/K, where K is the<br />

smallest power of two greater or equal to n, and x is<br />

a random integer in 0 to K − 1. It then constructs<br />

the arrangement defined by the segments and keeps<br />

the n nodes with the smallest x-coordinates. Finally,<br />

it adds edges to make the graph connected.<br />

void random planar graph(graph& G, int n)<br />

Series-Parallel Graphs<br />

void random sp graph(graph& G, int n, int m)<br />

creates a random planar graph G with n nodes. Uses<br />

the preceding function.<br />

creates a random series-parallel graph G with n nodes<br />

and m edges.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!