Opened 7 years ago

Closed 7 years ago

#13691 closed enhancement (fixed)

Graph.has_homomorphism_to

Reported by: ncohen Owned by: jason, ncohen, rlm
Priority: major Milestone: sage-5.6
Component: graph theory Keywords:
Cc: Merged in: sage-5.6.beta2
Authors: Nathann Cohen Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #13784 Stopgaps:

Description (last modified by vbraun)

This ticket adds a function that just checks whether there exists a homomorphism from the given graph to another one.

The classical LP patch :-)

Nathann

Apply trac_13691.patch, trac_13691_Sum.patch

Attachments (2)

trac_13691_Sum.patch (988 bytes) - added by vbraun 7 years ago.
Initial patch
trac_13691.patch (5.9 KB) - added by ncohen 7 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 Changed 7 years ago by ncohen

  • Status changed from new to needs_review

comment:2 Changed 7 years ago by vbraun

Lots of unnecessary whitespace changes in graphs/generic_graph.py

comment:3 Changed 7 years ago by vbraun

Also, needs to be rebased for #12091 (which is in sage-5.5.rc0)

comment:4 Changed 7 years ago by ncohen

  • Status changed from needs_review to needs_work

Oh... Right.. Sage-5-5.rc0 is when all my LP code breaks :-/

comment:5 Changed 7 years ago by ncohen

Hey, I just applied it on 5.5.rc0 and nothing bad happens. What do you think needs to be rebased ? O_o

Nathann

comment:6 Changed 7 years ago by vbraun

Did you run doctests for sage/graphs/graph.py? They do fail on the patchbot.

comment:7 Changed 7 years ago by ncohen

ahahahah.

Yeah, of course... I saw that the first file modified was generic_graph (ony whitespaces, of course :-P) and all tests passed, of course.

Ok, so it backfired. I won't play with whitespaces anymore :-P

Nathann

comment:8 Changed 7 years ago by ncohen

  • Status changed from needs_work to needs_review

Ok, patch updated... But I don't get something : how come the error was

      File "mip.pyx", line 2083, in sage.numerical.mip.Sum (sage/numerical/mip.c:10864)
      File "element.pyx", line 332, in sage.structure.element.Element.__getattr__ (sage/structure/element.c:3523)
      File "misc.pyx", line 204, in sage.structure.misc.getattr_from_other_class (sage/structure/misc.c:1509)
    AttributeError: 'sage.numerical.linear_functions.LinearFunction' object has no attribute 'sum'

(hence it came from the Sum function, hence the function still exists in Sage and can be imported) while it cannot be used with the new variables ? Why does it still exist after all your patches to replace the LP's symbolics ? O_o

Nathann

comment:9 Changed 7 years ago by vbraun

The capital-s Sum is still there, its just deprecated. Though there is a bug in it that apparently went unnoticed. I'll attach a patch.

Changed 7 years ago by vbraun

Initial patch

comment:10 Changed 7 years ago by vbraun

  • Description modified (diff)
  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

Positive review.

comment:11 Changed 7 years ago by ncohen

Thaaaaaaaaaaaaanks !!

comment:12 Changed 7 years ago by jdemeyer

  • Milestone changed from sage-5.5 to sage-5.6

comment:13 Changed 7 years ago by jdemeyer

  • Dependencies set to #13784
  • Status changed from positive_review to needs_work

This patch conflicts with #13784. This one should be rebased.

comment:14 Changed 7 years ago by ncohen

  • Status changed from needs_work to positive_review

Patch updated !

Nathann

Changed 7 years ago by ncohen

comment:15 Changed 7 years ago by jdemeyer

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