-
Notifications
You must be signed in to change notification settings - Fork 67
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
Implement Algebra.Graph.Undirected #83
Comments
@adicirstei Hi there!
We can define a function In fact, we have https://github.com/snowleopard/alga/blob/master/src/Algebra/Graph/Relation.hs#L497-L510 So, we can easily add |
An alternative would be to add Then we would be able to define the |
What would involve doing |
@adicirstei The simplest way forward is to define a
Then add a custom |
Great! I wasn’t sure how you were seeing it.
Adrian
… On 20 Jun 2018, at 19:24, Andrey Mokhov ***@***.***> wrote:
@adicirstei The simplest way forward is to define a newtype:
newtype UndirectedGraph a = UndirectedGraph { graph :: Graph a } deriving (Functor, ... )
Then add a custom Eq instance, and modify a couple of graph algorithms to correctly deal with undirected edges. Most of the API of this module would simply redirect to the inner graph.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@adicirstei Would you like to give this a try? I think it would be nice to add |
If anyone would like to attempt this, we now have https://hackage.haskell.org/package/algebraic-graphs-0.4/docs/Algebra-Graph-Relation-Symmetric.html |
@adicirstei are you working on this issue? If not, I'd be glad to give this a try! EDIT: @snowleopard would this replace this SymmetricRelation? Or would it be just an adapted API to work with the Graph data type? |
@bolt12 No, this is independent from your symmetric relations work. The implementation will be quite similar though: just add a newtype |
For me both P.S.: I assigned this issue to you. Thanks for volunteering! :) |
@snowleopard No problem! I'm happy to help! That's odd, I'll try and refork the repo! |
@snowleopard sorry to bloat this thread with this issue but can you figure out how to solve this? |
@bolt12 Not sure how to fix this at the moment. Let's fork this into a new issue. |
@snowleopard looking into this. I built the project and ghci runs fine! |
@snowleopard one question: should I use the Symmetric file as base or the Graph one? What would be preferable? Also the Graph one has rewrite rules and other stuff that I don't quite understand, but since it's a newtype I dont think I need to worry about them. EDIT: I'll base on one file for documentation inspiration and guidance mainly but I'll still follow the SymmetricRelation API! Probably there will be things that would be worth adding from the Graph that aren't in Symmetric like (===), induceJust (?) |
@bolt12 Yes, in general please follow the API of Don't worry about the rewrite rules for now. |
I think we can close this now, since the latest version has: http://hackage.haskell.org/package/algebraic-graphs-0.5/docs/Algebra-Graph-Undirected.html Thanks @bolt12! |
Awesome! You're welcome, it was a pleasure working with you in this PR!
…On Sat, 15 Feb 2020, 19:48 Andrey Mokhov, ***@***.***> wrote:
Closed #83 <#83>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#83?email_source=notifications&email_token=AE2SULL5EHS35I7BVD3VNETRDBBJTA5CNFSM4FF4OD32YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOWVBZSZI#event-3041106277>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2SULP4TL4FLC7BZB3UO7DRDBBJTANCNFSM4FF4OD3Q>
.
|
Hi,
I have a dumb question. At first I thought that a
SymmetricRelation
being aGraph
and aGraph
being aFunctor
I just can map a function over it. I was wrong as theGraph
was the theclass
not the data type.Any advice on an efficient way on how to do this?
Thanks!
The text was updated successfully, but these errors were encountered: