sage: G = graphs.PetersenGraph()
sage: sage.graphs.graph_fast.spring_layout_fast(G, iterations=50,
dim=2)

{0: [0.93950023361313362, -0.088093655912920787],
 1: [-0.032723044718243596, 0.0032620178712528453],
 2: [-0.78167205667257567, 0.25668081056701608],
 3: [-0.19695488333682584, 0.98041255292339935],
 4: [0.58132479783773938, 0.47340350688490596],
 5: [0.49845437783686958, -0.55590372729478854],
 6: [-0.57465246015041671, -0.1950317425495266],
 7: [-0.43627957601308087, -0.78398609879059378],
 8: [-0.017873656744623847, 0.40123713556835133],
 9: [0.02087626834802609, -0.49198079926709676]}
sage: sage.graphs.graph_fast.spring_layout_fast(G, iterations=50,
dim=3)

{0: [-0.79663372172927904, 0.073238636265134105, -0.110205072407995],
 1: [-0.39679012775524791, -0.45531453285129453, 0.19229911568902866],
 2: [0.583916842805277, -0.29482037203603834, -0.35300484373087798],
 3: [0.31333839588076368, -0.82308036816841157, -0.17071367903566684],
 4: [-0.3466286969143979, -0.12944151392594008, -0.68643103606195466],
 5: [0.162203407726943, 0.41219003959482542, 0.31128268509719276],
 6: [-0.3360001508400709, 0.18061516858269913, 0.69989672441041062],
 7: [0.66240777877858614, 0.65789911404118429, -0.35830809418354531],
 8: [0.33657350913289702, -0.32117355980454826, 0.72265020528580681],
 9: [-0.18238723708547017, 0.69988738830238983, -0.24746600506240019]}


On May 22, 7:46 am, "William Stein" <[EMAIL PROTECTED]> wrote:
> On Thu, May 22, 2008 at 7:43 AM, Robert Miller <[EMAIL PROTECTED]> wrote:
>
> > Nikos,
>
> >> This seems to work only with graphs already known to Sage but not with
> >> new graphs constructed by the user.  For example:
>
> > If you construct a new graph, the position dictionary is not set. You
> > can do so with the set_pos() command, and if there is no position dict
> > set when you plot, it uses the spring algorithm to construct an
> > embedding.
>
> I think the person asking the question wants to know how to *get* the
> output of the spring algorithm.
>
>  -- William
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to