I've unsuccessfully tried many ways of converting polygon points into a graph using Mathematica 7, and I am frustrated. I looked at this post, but it doesn't work:
Needs["Combinatorica`"];
crds = {{1, 10}, {2, 4}, {10, 5}, {20, 10}};
vertices = Range[Length[crds]];
edges = Thread[vertices \[DirectedEdge] RotateLeft[vertices]];
Graph[vertices, edges]
produces errors:
Syntax::sntxf: "\!\(\*StyleBox[\"\\\"\\\\\\\"\\\"\", \"MT\"]\)\!\(\*StyleBox[\!
\(vertices\), \"MT\"]\)\!\(\*StyleBox[\"\\\"\\\\\\\" cannot be followed by \\\\\\\"
\\\"\", \"MT\"]\)\!\(\*StyleBox[\!\(\(\(\\[ DirectedEdge]\)\) \(\(RotateLeft[vertices]
\)\)\), \"MT\"]\)\!\(\*StyleBox[\"\\\"\\\\\\\".\\\"\", \"MT\"]\)\!\(\*StyleBox[\!
\(\"\"\), \"MT\"]\)"
Syntax::tsntxi: "\!\(\*StyleBox[\"\\\"\\\\\\\"\\\"\", \"MT\"]\)\!\(\*StyleBox[\!\(\\[
DirectedEdge]\), \"MT\"]\)\!\(\*StyleBox[\"\\\"\\\\\\\" is incomplete; more input is
needed.\\\"\", \"MT\"]\)\!\(\*StyleBox[\!\(\"\"\), \"MT\"]\)"
Syntax::sntxi: Incomplete expression; more input is needed.
Any ideas?
Graph[e, v, opts]
, notGraph[v, e]
as with the new built-in Graph. $\endgroup$