#18860: Faster Poyhedron.graph()
-------------------------+-------------------------------------------------
Reporter: | Owner:
ncohen | Status: new
Type: | Milestone: sage-6.8
enhancement | Resolution:
Priority: major | Merged in:
Component: | Reviewers:
geometry | Work issues:
Keywords: | Commit:
Authors: | d084b1f2d0a7fa39fd522079aba39494f1704526
Nathann Cohen | Stopgaps:
Report Upstream: N/A |
Branch: |
public/18860 |
Dependencies: |
#18779 |
-------------------------+-------------------------------------------------
Old description:
> With this branch, {{{polytopes.Gosset_3_21().graph()}}} takes 200ms,
> against 16s before.
>
> There is however, a mystery in the code: I hard-coded a constant '26'
> which I expected to be equal to 'd-1'. If we can solve this mistery, we
> get a speedup.
>
> This 26 has been picked so that the following works:
>
> {{{
> sage: g=graphs.GossetGraph()
> sage: g.is_isomorphic(polytopes.Gosset_3_21().graph())
> True
> }}}
New description:
With this branch, {{{polytopes.Gosset_3_21().graph()}}} takes 300ms,
against 16s before.
The 'definition' used to compute adjacent vertices can be found in
[comment:10]
And of course the following works:
{{{
sage: g=graphs.GossetGraph()
sage: g.is_isomorphic(polytopes.Gosset_3_21().graph())
True
}}}
--
Comment (by ncohen):
A bit cleaner: I moved the code to the `.graph()`, method for apparently
the `_vertex_adjacency_matrix` is not what it claims to be. Its dimension
may not even be the number of vertices (if you have rays n your
polyhedron) [1].
With this, all tests pass in the `geometry` folder.
Nathann
[1] You can see what goes wrong by adding 'return
self.graph().adjacency_matrix()` in the first line of
`_vertex_adjacency_matrix`.
--
Ticket URL: <http://trac.sagemath.org/ticket/18860#comment:12>
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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.