Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Dijkstra to discover shortest coercion path #8878

Open
nthiery opened this issue May 4, 2010 · 3 comments
Open

Use Dijkstra to discover shortest coercion path #8878

nthiery opened this issue May 4, 2010 · 3 comments

Comments

@nthiery
Copy link
Contributor

nthiery commented May 4, 2010

In #7420, it was discussed that the current coercion model is using depth first search to find for coercion paths between different parents, and that it would be better to use breath-first / Dijkstra to get a shortest coercion path. For example, we obtained once a coercion path of length 20 among symmetric functions.

A preliminary patch lies on the Sage-Combinat server: http://combinat.sagemath.org/patches/file/tip/trac_8878_coerce_dijkstra-nt.patch but has not been touched in a long while and has most likely bit roten.

Note: the following issue is probably related:

A = CombinatorialFreeModule(QQ, ZZ, prefix = "A")
B = CombinatorialFreeModule(QQ, ZZ, prefix = "B")
C = CombinatorialFreeModule(QQ, ZZ, prefix = "C")
D = CombinatorialFreeModule(QQ, ZZ, prefix = "D")

def make_morph(X, Y):
    X.module_morphism(Y.monomial).register_as_coercion()

make_morph(A,B)
make_morph(B,A)

make_morph(C,A)

make_morph(D,C)

d = D.monomial(1)

A(d)
B(d)

CC: @sagetrac-sage-combinat

Component: coercion

Keywords: morphism

Author: Nicolas M. Thiéry

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

@nthiery

This comment has been minimized.

@darijgr
Copy link
Contributor

darijgr commented Jun 22, 2013

comment:3

The link to sage-combinat is dead.

(Posting this mainly to get a CC on this ticket.)

@nthiery

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants