#31681 closed defect (fixed)

DiGraph.layout_acyclic_dummy assumes it can sort lists of vertices

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-9.4
Component: graph theory Keywords:
Cc: dcoudert, dimpase Merged in:
Authors: David Coudert Reviewers: Matthias Koeppe
Report Upstream: N/A Work issues:
Branch: 280a82d (Commits, GitHub, GitLab) Commit: 280a82d6426dc847bf661170c83cccfb74dae1ee
Dependencies: Stopgaps:

Status badges

Description

This can fail when the vertices do not define <

~/s/sage/sage-rebasing/local/lib/python3.9/site-packages/sage/graphs/digraph.py in <listcomp>(.0)
   3323                 raise ValueError("`self` should be an acyclic graph")
   3324             levels = self.level_sets()
-> 3325             levels = [sorted(z) for z in levels]
   3326             if rankdir=='down' or rankdir=='left':
   3327                 levels.reverse()

TypeError: '<' not supported between instances of 'DifferentiableManifold_with_category' and 'DifferentiableManifold_with_category'

Change History (5)

comment:1 Changed 15 months ago by dcoudert

Which option do you prefer:

  • sort in best effort mode with a try except for each level
  • no sorting at all

comment:2 Changed 15 months ago by dimpase

a directed acyclic graph carries an partial order - ideally a drawing ought to respect it.

comment:3 Changed 15 months ago by dcoudert

  • Authors set to David Coudert
  • Branch set to public/graphs/31681_dummy
  • Commit set to 280a82d6426dc847bf661170c83cccfb74dae1ee
  • Status changed from new to needs_review

Let's try this.


New commits:

280a82dtrac #31681: fix sorting in layout_acyclic_dummy

comment:4 Changed 15 months ago by mkoeppe

  • Reviewers set to Matthias Koeppe
  • Status changed from needs_review to positive_review

This works well, thanks a lot

comment:5 Changed 13 months ago by vbraun

  • Branch changed from public/graphs/31681_dummy to 280a82d6426dc847bf661170c83cccfb74dae1ee
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.