Opened 7 months ago

Last modified 2 weeks ago

#27513 needs_review enhancement

Allow custom order for edges as well as vertices for incidence matrix

Reported by: kcrisman Owned by:
Priority: minor Milestone: sage-9.0
Component: graph theory Keywords:
Cc: Merged in:
Authors: David Coudert Reviewers:
Report Upstream: N/A Work issues:
Branch: public/graphs/27513_incidence_matrix (Commits) Commit: 25da8838a73ecde89b0bbbd0aced7c5249e19f83
Dependencies: Stopgaps:


See this SO question, where the question is how to use incidence_matrix in such a way as to order the vertices and the edges as desired. One can specify vertex order, but not edges.

Change History (7)

comment:1 Changed 7 months ago by dcoudert

To fill the matrix, we just need a mapping from edges to integers. That's the easy part.

The hard parts are

  • to check that the given list of edges is exactly the list of edges of the graph without sorting (Python 3)
  • to decide what to do if the input list of edges has labels (raise an error or consider only the vertices)
  • possibly to deal with multiple edges / loops. We can decide that the method works only for simple (di)graph

comment:2 Changed 6 months ago by dcoudert

  • Authors set to David Coudert
  • Branch set to public/graphs/27513_incidence_matrix
  • Commit set to 94ec80fe3ecd235591012243eb46842bbf5c478a
  • Status changed from new to needs_review

This should do the job. Note that edges are considered without labels. It is possible to change that if needed.

New commits:

94ec80ftrac #27513: allow to specify the order of edges in incidence_matrix

comment:3 Changed 6 months ago by git

  • Commit changed from 94ec80fe3ecd235591012243eb46842bbf5c478a to 25da8838a73ecde89b0bbbd0aced7c5249e19f83

Branch pushed to git repo; I updated commit sha1. New commits:

25da883trac #27513: allow to give edges with labels

comment:4 Changed 6 months ago by dcoudert

You can now give edges with labels. This might ease the use of the method.

comment:5 Changed 4 months ago by embray

  • Milestone changed from sage-8.8 to sage-8.9

Moving tickets from the Sage 8.8 milestone that have been actively worked on in the last six months to the next release milestone (optimistically).

comment:6 Changed 4 months ago by dcoudert

This tickets is awaiting for review. Thanks.

comment:7 Changed 2 weeks ago by dcoudert

  • Milestone changed from sage-8.9 to sage-9.0
Note: See TracTickets for help on using tickets.