Ask Your Question
0

Adding relations to a poset

asked 9 years ago

Erel Segal-Halevi gravatar image

updated 8 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 9 years ago

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.

Preview: (hide)
link

Comments

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

Erel Segal-Halevi gravatar imageErel Segal-Halevi ( 9 years ago )

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: 9 years ago

Seen: 751 times

Last updated: Sep 25 '15