NAME
Graph::Maker::Dragon - create dragon graph
SYNOPSIS
use Graph::Maker::Dragon;
$graph = Graph::Maker->new ('dragon', level => 4);
DESCRIPTION
Graph::Maker::Dragon creates Graph.pm graphs of the Heighway/Harter dragon curve.
*---* *---*
| | | |
*---*---* *---* level => 5
| |
*---* *---* *---*
| | |
*---*---*---*
| | |
*---*---*
|
*---*
|
* *---*
| |
*---*
Vertex names are integer coordinates "X,Y" which are locations in the usual layout, starting at the origin "0,0" and spiralling anti-clockwise. Of course as a graph there's no need to actually use these coordinates for any display etc.
The first and last vertices are degree 1. All others are degree 2 or 4, being single-visited or double-visited points of the curve.
Arms
Optional parameter arms => $integer selects up to 4 curve arms starting at the origin and each rotated 90 degrees around. 4 arms eventually fill the plane, having edges horizontally or vertically between all integer points.
*---*
|
*---* *---* level => 4
| | | arms => 4
*---*---*---* *---*
| | | | |
*---* *---*---*---*---*---*
| | | | | | |
* *---*---*---O---*---*---* *
| | | | | | |
*---*---*---*---*---* *---*
| | | | |
*---* *---*---*---*
| | |
*---* *---*
|
*---*
Blob
Optional parameter part => 'blob' selects the sub-graph which is the middle biggest blob in curve $level.
*---*
| | level => 6
*---* *---*---*---* part => 'blob'
| | | | |
*---*---*---*---*
| | | |
*---* *---*
The arms parameter can be given but is not very interesting for the blob part. The middle blob of the arms do not touch so the effect is just to generate arms many disconnected copies.
FUNCTIONS
$graph = Graph::Maker->new('dragon', key => value, ...)-
The key/value parameters are
level => curve expansion level >= 0 arms => 1 to 4 (default 1) graph_maker => subr(key=>value) constructor, default Graph->newOther parameters are passed to the constructor, either
graph_makerorGraph->new().If the graph is directed (the default) then edges are added both ways between vertices. Option
undirected => 1creates an undirected graph and for it there is a single edge between vertices.
SEE ALSO
Graph::Maker, Graph::Maker::Twindragon
HOME PAGE
http://user42.tuxfamily.org/graph-maker-other/index.html
LICENSE
Copyright 2015, 2016, 2017, 2018, 2019, 2020, 2021 Kevin Ryde
This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with This file. If not, see http://www.gnu.org/licenses/.