Opened 8 years ago

Closed 8 years ago

#13919 closed defect (fixed)

Bug in Graph() when input is a weighted matrix

Reported by: ncohen Owned by: jason, ncohen, rlm
Priority: major Milestone: sage-5.7
Component: graph theory Keywords:
Cc: chapoton Merged in: sage-5.7.beta1
Authors: Nathann Cohen Reviewers: Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


As reported in [1], the following code produces an exception :

sage: B = {0:{1:2,2:5,3:4},1:{2:2,4:7},2:{3:1,4:4,5:3},3:{5:4},4:{5:1,6:5},5:{6:7}} 
sage: grafo3 = Graph(B,weighted=True) 
sage: matad = grafo3.weighted_adjacency_matrix() 
sage: grafo4 = Graph(matad,format = "adjacency_matrix", weighted=True) 
sage: grafo4.shortest_path(0,6,by_weight=True)

This, because Sage has some problems understanding that the graph is not a multigraph...


Attachments (1)

trac_13919.patch (5.1 KB) - added by ncohen 8 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 8 years ago by ncohen

  • Status changed from new to needs_review

comment:2 Changed 8 years ago by chapoton

Please correct the failing doctest, otherwise it's ok

Changed 8 years ago by ncohen

comment:3 Changed 8 years ago by ncohen

  • Cc chapoton added

Updated !


comment:4 Changed 8 years ago by chapoton

  • Status changed from needs_review to positive_review

ok, let it go. Positive review !

comment:5 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.6 to sage-5.7
  • Reviewers set to Frédéric Chapoton

comment:6 Changed 8 years ago by jdemeyer

  • Merged in set to sage-5.7.beta1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.