MCPcopy Create free account
hub / github.com/ElementsProject/lightning / graph_add_arc

Function graph_add_arc

plugins/askrene/child/graph.c:22–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22bool graph_add_arc(struct graph *graph, const struct arc arc,
23 const struct node from, const struct node to)
24{
25 assert(from.idx < graph->max_num_nodes);
26 assert(to.idx < graph->max_num_nodes);
27
28 const struct arc dual = arc_dual(graph, arc);
29
30 if (arc.idx >= graph->max_num_arcs || dual.idx >= graph->max_num_arcs)
31 return false;
32
33 graph_push_outbound_arc(graph, arc, from);
34 graph_push_outbound_arc(graph, dual, to);
35
36 return true;
37}
38
39struct graph *graph_new(const tal_t *ctx, const size_t max_num_nodes,
40 const size_t max_num_arcs, const size_t arc_dual_bit)

Callers 9

solve_caseFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
problem1Function · 0.85
problem2Function · 0.85
mainFunction · 0.85
init_linear_networkFunction · 0.85

Calls 2

graph_push_outbound_arcFunction · 0.85
arc_dualFunction · 0.70

Tested by 7

solve_caseFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
problem1Function · 0.68
problem2Function · 0.68
mainFunction · 0.68