Opened 12 years ago
Closed 6 years ago
#10507 closed defect (wontfix)
In Generic graphs, adjacency matrices with non-negative non-integral entries are treated as "multi-edge" instead of "weighted"
Reported by: | xqwang | Owned by: | xqwang |
---|---|---|---|
Priority: | minor | Milestone: | sage-duplicate/invalid/wontfix |
Component: | graph theory | Keywords: | weighted adjacency matrix |
Cc: | tscrim | Merged in: | |
Authors: | Reviewers: | Frédéric Chapoton | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
Let M be a symmetric, non-negative, and non-integral valued matrix. The Graph Theory module (graph.py) treats is as the adjacency matrix of a multi-edge graph, which does not make sense. It is more reasonable and intuitive to treat is as the adjacency matrix of a weight graph.
This defect is observed in Sage 4.4.1 and Sage 4.6
sage: M = Matrix([[0,1,1],[1,0,1/2],[1,1/2,0]]); M [ 0 1 1] [ 1 0 1/2] [ 1 1/2 0] sage: Graph(M) Multi-graph on 3 vertices
Change History (4)
comment:1 Changed 12 years ago by
- Owner changed from jason, ncohen, rlm to xqwang
comment:2 Changed 6 years ago by
- Cc tscrim added
- Milestone set to sage-duplicate/invalid/wontfix
- Status changed from new to needs_review
This has been corrected at some point. Travis, can you confirm and put to positive_review.
comment:3 Changed 6 years ago by
- Reviewers set to Frédéric Chapoton
- Status changed from needs_review to positive_review
ok, seems to work smoothly
comment:4 Changed 6 years ago by
- Resolution set to wontfix
- Status changed from positive_review to closed
Determined to be invalid/duplicate/wontfix (closing as "wontfix" as a catch-all resolution).
Note: See
TracTickets for help on using
tickets.
This defect can be fixed by changing the following two lines of code in $SAGE_HOME/local/lib/python/site-packages/sage/graphs/graph.py
TO
This change will make sure that if the adjacency matrix is non-integral then its entries are treated as weights (in stead of # of edges).