discussion of the problem
@khird I have never done anything with digraphs nor really studied graph theory and so I am not really sure I am equipped to handle this challenge. However, let me ask a few things and perhaps I will learn something. Given that you have an edge <x, y, z> if there is another edge <y, x, z> either one could be removed without affecting the vertices? Or does a vertex need at least one start point and one end point? Looking at the example, it would have seemed the solution should have excluded <2,1,84> as it already had <1,2,40> because it doesn't affect the vertices but reduces the count. Is there an issue with "length" that I am not quite sure I follow?
@khird okay, so that is. What length means. I will look at it deeper and maybe ask some other quesrions
@Absinthe
Think of edges in a directed graph as arrows, which you can follow in the direction they point but not in the opposite direction. The edge <1, 2, 40> allows you to go *from* node 1 *to* node 2, while <2, 1, 84> allows you to go *to* node 1 *from* node 2. So if you exclude the edge you suggested, the graph no longer satisfies the third condition (k-hop rule) because it's no longer possible to get from node 4 to node 1 in two hops (shortest path is 4->2->3->1, which is three hops).