Conversation
krhubert
left a comment
There was a problem hiding this comment.
With this PR a lot of workflow methods handle the graph and not workflow itself. As in previous PR I would love to see the part where the graph is a separate struct.
| return fmt.Errorf("non connected graph") | ||
| } | ||
| if !w.isMonoParental() { | ||
| return fmt.Errorf("non mono-parental graph") |
There was a problem hiding this comment.
I've never see a mono-parental word to describe a graph, can you point out the article/algorithm where they use such terminology?
| return fmt.Errorf("non mono-parental graph") | |
| return fmt.Errorf("the edge %s has to or more parents") |
Also, a method name can be changed.
There was a problem hiding this comment.
This is not the right term, I couldn't find a better name. If you know any name that describes that each node should have only one parent I'm really happy to change this
There was a problem hiding this comment.
changed the function to maximumParentNode(max int) that returns true when all the nodes have less than max parents.
Co-Authored-By: krhubert <krhubert@gmail.com>
I agree that's why I started to move all the graph-related stuff in the algorithm file. I don't want to charge too much this PR and also I have to have a look at https://github.com/gonum/gonum/tree/master/graph that might replace all. So this will certainly change soon. |
1f81955 to
a15be27
Compare
NicolasMahe
left a comment
There was a problem hiding this comment.
it seems good except the function hasNodes that return the opposite of what the function's name is saying. The name should also by singular hasNode has it should true if at least 1 node exist.
14a43ff to
cf7966d
Compare
Co-Authored-By: Nicolas Mahé <nicolas@mesg.com>
Add workflow validation:
With this validation, we are allowing only directed tree graphs which is a family of DAG.
You can use the test from this PR: #1209