Boosting performance: Sage to Python/Networkx transition


I converted the Sage implementation to a pure Python / Networkx solution … and improved the code, which will need extra improvement.

  • sage 4ct.py -r 2000
  • python3 4ct_without_sage.py -r 2000
SagePython3 + Networkx
Random graph creation17 min 59 s
* RandomTriangulation
22 s
* Custom
Planar embedding16 min 09 s
* dual + set_embedding=True
0 s
* Not necessary
Elaboration2 min 12 s1 min 58 s

Here is the file:

Other run:

  • sage 4ct.py -r 1000
  • python3 4ct_without_sage.py -r 1000
SagePython3 + Networkx
Random graph creation3 min 19 s6 s
Planar embedding2 min 44 s0 s
Elaboration14 s23 s

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.