sagemath / sage

Main repository of SageMath. Now open for Issues and Pull Requests.
https://www.sagemath.org
Other
1.21k stars 421 forks source link

Graph.has_homomorphism_to #13691

Closed 6bdad4c1-1e26-4f2f-a442-a01a2292c181 closed 11 years ago

6bdad4c1-1e26-4f2f-a442-a01a2292c181 commented 11 years ago

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

Depends on #13784

Component: graph theory

Author: Nathann Cohen

Reviewer: Volker Braun

Merged: sage-5.6.beta2

Issue created by migration from https://trac.sagemath.org/ticket/13691

vbraun commented 11 years ago
comment:2

Lots of unnecessary whitespace changes in graphs/generic_graph.py

vbraun commented 11 years ago
comment:3

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

6bdad4c1-1e26-4f2f-a442-a01a2292c181 commented 11 years ago
comment:4

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

6bdad4c1-1e26-4f2f-a442-a01a2292c181 commented 11 years ago
comment:5

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

Nathann

vbraun commented 11 years ago
comment:6

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

6bdad4c1-1e26-4f2f-a442-a01a2292c181 commented 11 years ago
comment:7

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

6bdad4c1-1e26-4f2f-a442-a01a2292c181 commented 11 years ago
comment:8

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

vbraun commented 11 years ago
comment:9

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.

vbraun commented 11 years ago

Initial patch

vbraun commented 11 years ago
comment:10

Attachment: trac_13691_Sum.patch.gz

Positive review.

vbraun commented 11 years ago

Description changed:

--- 
+++ 
@@ -3,3 +3,6 @@
 The classical LP patch `:-)`

 Nathann
+
+
+Apply trac_13691.patch, trac_13691_Sum.patch
vbraun commented 11 years ago

Reviewer: Volker Braun

6bdad4c1-1e26-4f2f-a442-a01a2292c181 commented 11 years ago
comment:11

Thaaaaaaaaaaaaanks !!

jdemeyer commented 11 years ago
comment:13

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

jdemeyer commented 11 years ago

Dependencies: #13784

6bdad4c1-1e26-4f2f-a442-a01a2292c181 commented 11 years ago
comment:14

Patch updated !

Nathann

jdemeyer commented 11 years ago
comment:15

Attachment: trac_13691.patch.gz

jdemeyer commented 11 years ago

Merged: sage-5.6.beta2