#19583: random triangulation as simplicial complex
-------------------------------------+-------------------------------------
Reporter: chapoton | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-7.1
Component: algebraic | Resolution:
topology | Merged in:
Keywords: random simplicial | Reviewers:
complex | Work issues:
Authors: Frédéric Chapoton | Commit:
Report Upstream: N/A | 0f5599cd1f330160f99668240a859cf167be9a03
Branch: u/chapoton/19583 | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by ncohen):
> Some timings now that we have the embedding:
> {{{
> sage: %timeit SimplicialComplex([set(flatten(d)) for d in
graphs.RandomTriangulation(100).faces()])
> 10 loops, best of 3: 82.6 ms per loop
> sage: %timeit simplicial_complexes.RandomTwoSphere(100)
> 100 loops, best of 3: 5.26 ms per loop
> }}}
> so going through the graph to get the simplicial complex is not
efficient..
Some other timings:
{{{
def triangles(G):
G = G.relabel(inplace=False)
return [(u,v,w) for u,L in G._embedding.iteritems()
for v,w in zip(L,L[1:]+[L[0]]) if u<v and u<w]
sage: %timeit graphs.RandomTriangulation(1000)
1 loops, best of 3: 258 ms per loop
sage: %timeit
SimplicialComplex(triangles(graphs.RandomTriangulation(1000)),maximality_check=False)
1 loops, best of 3: 304 ms per loop
sage: %timeit simplicial_complexes.RandomTwoSphere(1000)
1 loops, best of 3: 299 ms per loop
}}}
And a check:
{{{
sage: g=graphs.RandomTriangulation(1000)
sage: h=Graph()
sage: _=map(h.add_cycle,triangles(g))
sage: g == h
True
}}}
I have too much respect for you to think that you even gave it a decent
try. You would have at least added `maximality_check=False`, as I made
this remark this very morning.
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/19583#comment:32>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.