79089385

Date: 2024-10-15 09:54:58
Score: 0.5
Natty:
Report link

You can pass the weight as extra parameter like:

graph.setEdge(A, B, { weight });

Then, when using dagre algorithm like dijkstra you can override the weighting function like:

const paths = dagre.graphlib.alg.dijkstra(graph, root, (e) => {
    const edge = graph.edge(e);
    return edge.weight;
})
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: barbenezra