-
Notifications
You must be signed in to change notification settings - Fork 39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This seems mostly reasonable to me. I raised a couple questions, but I'm also not the most experienced user of this library, so I'm open to being called a fool. :)
core/src/main/scala/Graph.scala
Outdated
* Cheapest path from vertex `s` to vertex `t` under the cost function `costFkt` with labels | ||
* @group bfs | ||
*/ | ||
def cheapestPath[C](s: N, t: N, costFkt: (LNode[N,A],B,LNode[N,A]) => C)(implicit num: Numeric[C]): Option[LPath[N,B]] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a little more generic as C: Monoid: Order
. I imagine C
would usually be numeric in the real world, but it doesn't have to be.
core/src/main/scala/Graph.scala
Outdated
*/ | ||
def cheapestPath[C](s: N, t: N, costFkt: (LNode[N,A],B,LNode[N,A]) => C)(implicit num: Numeric[C]): Option[LPath[N,B]] = { | ||
require(contains(s)) | ||
require(contains(t)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we return None
here, or is it important to distinguish a missing vertex from an empty searchtree? The exceptions make me a bit uncomfortable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, ideally we don't throw exceptions but instead codify things into the type system :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewrite all of this in idris and I will happily encode that in the signature :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, until someone publishes quividris, my question remains. :) Would a None
be an acceptable result, or do we need a third value to return?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for not answering this sooner. I think that would be perfectly fine.
- Redecoration includes the focus of the decomposition when acting on the rest of the graph - Fix GDecomp generator so incorrect instances cannot be built (this should probably be a smart constructor)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks
Uh-oh. This doesn't compile together with the changes to #23 and #26 are breaking changes. I'm planning to open a quiver6 branch so we only bump the major version once with our automated release process. We can target that with whatever comes of your open PRs and get a release cut before the cats port. |
I can fix this tomorrow. Ideally the LPath stuff would be merged by then. If not, I'll cherry pick it into this branch as well. |
Great. I'll merge #23 into the quiver-6 branch now, and you can target that branch with your fixed up version of this, and we'll be ready to release. |
Closing because now targeting quiver-6 in #28 |
Functionality for finding the cheapest path between two nodes according to a cost function that sees both nodes and edge labels.