Ask Your Question
0

Adding relations to a poset

asked 2015-09-25 10:33:54 +0100

Erel Segal-Halevi gravatar image

updated 2016-07-12 20:32:28 +0100

FrédéricC gravatar image

I am trying to write a program that proves that some set of inequalities is not compatible. I am trying to do this with Sage's Poset class. My idea is to create a basic poset, then gradually add relations, then finally check the number of linear extensions.

The only problem is: I didn't find a way to add relations to an existing Poset. How do I do this in Sage?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2015-09-25 11:42:22 +0100

Nathann gravatar image

It seems that you want to add relations to a poset until... it is not a poset anymore?

Unfortunately (for you and I), posets have been made to be immutable (i.e. you can't modify one once it is built). Fortunately (for you and I) you do not need to use posets. You can use directed graphs instead. And you can add/remove edges from a given DiGraph, and then I expect that what you want to ensure is that my_digraph.is_directed_acyclic returns True.

edit flag offensive delete link more

Comments

This makes sense. I want to add edges until the digraph becomes cyclic.

Erel Segal-Halevi gravatar imageErel Segal-Halevi ( 2015-09-25 14:43:12 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-09-25 10:33:54 +0100

Seen: 561 times

Last updated: Sep 25 '15