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
| Sage | Python3 + Networkx | |
| Random graph creation | 17 min 59 s * RandomTriangulation | 22 s * Custom |
| Planar embedding | 16 min 09 s * dual + set_embedding=True | 0 s * Not necessary |
| Elaboration | 2 min 12 s | 1 min 58 s |

Here is the file:
Other run:
- sage 4ct.py -r 1000
- python3 4ct_without_sage.py -r 1000
| Sage | Python3 + Networkx | |
| Random graph creation | 3 min 19 s | 6 s |
| Planar embedding | 2 min 44 s | 0 s |
| Elaboration | 14 s | 23 s |