Opened 7 years ago

Closed 7 years ago

#16386 closed defect (duplicate)

matching_polynomial of Grid2dGraph bombs

Reported by: rws Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: graph theory Keywords: grid graph
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


sage: g = graphs.Grid2dGraph(4,4)
sage: g.matching_polynomial()
TypeError                                 Traceback (most recent call last)
<ipython-input-51-60f79320a776> in <module>()
----> 1 g.matching_polynomial()

/home/ralf/sage-6.2-x86_64-Linux/local/lib/python2.7/site-packages/sage/graphs/ in sage.graphs.matchpoly.matching_polynomial (sage/graphs/matchpoly.c:2718)()

TypeError: an integer is required

The same with matching_polynomial(graphs.Grid2dGraph(3,3)).

Change History (4)

comment:1 Changed 7 years ago by chapoton

You need first to rebabel the graph

sage: g = graphs.Grid2dGraph(4,4)
sage: g.relabel()
sage: g.matching_polynomial()
x^16 - 24*x^14 + 224*x^12 - 1044*x^10 + 2593*x^8 - 3388*x^6 + 2150*x^4 - 552*x^2 + 36

Its probably because the matching polynomial assumes that vertices are integers.

comment:2 Changed 7 years ago by chapoton

  • Milestone changed from sage-6.3 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

duplicate of #15545

comment:3 Changed 7 years ago by rws

  • Status changed from needs_review to positive_review

comment:4 Changed 7 years ago by vbraun

  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.