cassovary icon indicating copy to clipboard operation
cassovary copied to clipboard

Undirected Graph Support in Cassovary

Open plofgren opened this issue 10 years ago • 10 comments

Related to https://github.com/twitter/cassovary/issues/140 The idea of this wrapper is that each graph implementation shouldn't need custom code for StoredGraphDir.Mutual. We can write a single wrapper which works with any graph implementation. Here is an initial undirected graph class. If this looks good, I can add a test and support for mutable undirected graphs to this pull request. @pankajgupta

plofgren avatar Jan 30 '15 01:01 plofgren

@szymonm : I was also just thinking that, and agree that parametrizing Graph with NodeType will be better. Let's do that in a separate PR. See my comment above, we can do getNodeById to return UndirectedNode in UndirectedGraph regardless.

pankajgupta avatar Jan 30 '15 18:01 pankajgupta

On the other hand, I used: https://github.com/scala-graph/scala-graph.

They use:

trait GraphLike[
  N,
  E[X]  <: EdgeLikeIn[X], 
  +This[X, Y[X]<:EdgeLikeIn[X]] <: GraphLike[X,Y,This] with AnySet[Param[X,Y]] with Graph[X,Y]
]

and IMO this type magic makes the library very hard to use...

So let's be carefull about that.

szymonm avatar Jan 31 '15 10:01 szymonm

:) Agreed that there's a balance. Parametrizing by NodeType is good I think.

pankajgupta avatar Jan 31 '15 21:01 pankajgupta

(Sorry for the delay). I changed UndirectedGraph to a trait, made UndirectedNode a sub-trait of UnidirectedNode, and made UndirectedGraph's methods return UndirectedNode. I think that addresses all of your comments. I also just rebased from master.

plofgren avatar Feb 09 '15 06:02 plofgren

Ouch, somehow I missed your updated commits, Peter! Also, looks your rebase has gone awry as the diff in this PR is showing other changes unrelated to your change. May I ask you to build a new patch or create a clean one on top of current master. Thanks.

pankajgupta avatar Feb 20 '15 04:02 pankajgupta

Ping @plofgren

pankajgupta avatar Mar 05 '15 08:03 pankajgupta

To be honest, I don't think I'll get back to this until at least after I finish my PhD in a couple months. It doesn't really add functionality, so I propose we just drop it and optionally change the documentation as suggested in #140.

plofgren avatar Apr 19 '15 21:04 plofgren

Ah, you have done a lot of work. Let's leave this open for now and hope you come back to it when you get time. Or someone else might pick it up too.

pankajgupta avatar Apr 20 '15 05:04 pankajgupta

Sounds good.

plofgren avatar Apr 20 '15 16:04 plofgren

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 4 committers have signed the CLA.

:x: Pankaj Gupta
:x: plofgren
:x: szymonm
:x: pankajgupta


Pankaj Gupta seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Jul 18 '19 15:07 CLAassistant