From 506045d622586d8d28f63b45834c9ce9032fd22c Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Tue, 15 Oct 2024 10:09:26 +0100 Subject: [PATCH 01/23] askrene: add a new graph abstraction Changelog-EXPERIMENTAL: askrene new graph abstraction Signed-off-by: Lagrang3 --- plugins/askrene/Makefile | 6 +- plugins/askrene/graph.c | 79 +++++++++++++++ plugins/askrene/graph.h | 165 +++++++++++++++++++++++++++++++ plugins/askrene/test/Makefile | 18 ++++ plugins/askrene/test/run-graph.c | 61 ++++++++++++ 5 files changed, 327 insertions(+), 2 deletions(-) create mode 100644 plugins/askrene/graph.c create mode 100644 plugins/askrene/graph.h create mode 100644 plugins/askrene/test/Makefile create mode 100644 plugins/askrene/test/run-graph.c diff --git a/plugins/askrene/Makefile b/plugins/askrene/Makefile index 4628e80f2151..883dfb9c6caf 100644 --- a/plugins/askrene/Makefile +++ b/plugins/askrene/Makefile @@ -1,5 +1,5 @@ -PLUGIN_ASKRENE_SRC := plugins/askrene/askrene.c plugins/askrene/layer.c plugins/askrene/reserve.c plugins/askrene/mcf.c plugins/askrene/dijkstra.c plugins/askrene/flow.c plugins/askrene/refine.c plugins/askrene/explain_failure.c -PLUGIN_ASKRENE_HEADER := plugins/askrene/askrene.h plugins/askrene/layer.h plugins/askrene/reserve.h plugins/askrene/mcf.h plugins/askrene/dijkstra.h plugins/askrene/flow.h plugins/askrene/refine.h plugins/askrene/explain_failure.h +PLUGIN_ASKRENE_SRC := plugins/askrene/askrene.c plugins/askrene/layer.c plugins/askrene/reserve.c plugins/askrene/mcf.c plugins/askrene/dijkstra.c plugins/askrene/flow.c plugins/askrene/refine.c plugins/askrene/explain_failure.c plugins/askrene/graph.c +PLUGIN_ASKRENE_HEADER := plugins/askrene/askrene.h plugins/askrene/layer.h plugins/askrene/reserve.h plugins/askrene/mcf.h plugins/askrene/dijkstra.h plugins/askrene/flow.h plugins/askrene/refine.h plugins/askrene/explain_failure.h plugins/askrene/graph.h PLUGIN_ASKRENE_OBJS := $(PLUGIN_ASKRENE_SRC:.c=.o) $(PLUGIN_ASKRENE_OBJS): $(PLUGIN_ASKRENE_HEADER) @@ -8,3 +8,5 @@ PLUGIN_ALL_SRC += $(PLUGIN_ASKRENE_SRC) PLUGIN_ALL_HEADER += $(PLUGIN_ASKRENE_HEADER) plugins/cln-askrene: $(PLUGIN_ASKRENE_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS) $(CCAN_OBJS) bitcoin/chainparams.o common/gossmap.o common/sciddir_or_pubkey.o common/gossmods_listpeerchannels.o common/fp16.o common/dijkstra.o common/bolt12.o common/bolt12_merkle.o wire/bolt12_wiregen.o wire/onion_wiregen.o common/route.o + +include plugins/askrene/test/Makefile diff --git a/plugins/askrene/graph.c b/plugins/askrene/graph.c new file mode 100644 index 000000000000..a38f4a98ea16 --- /dev/null +++ b/plugins/askrene/graph.c @@ -0,0 +1,79 @@ +#include "config.h" +#include + +/* in the background add the actual arc or dual arc */ +static void graph_push_outbound_arc(struct graph *graph, const struct arc arc, + const struct node node) +{ + assert(arc.idx < tal_count(graph->arc_tail)); + + /* arc is already added, skip */ + if (graph->arc_tail[arc.idx].idx != INVALID_INDEX) + return; + + graph->arc_tail[arc.idx] = node; + + assert(node.idx < tal_count(graph->node_adjacency_first)); + const struct arc first_arc = graph->node_adjacency_first[node.idx]; + + assert(arc.idx < tal_count(graph->node_adjacency_next)); + graph->node_adjacency_next[arc.idx] = first_arc; + + assert(node.idx < tal_count(graph->node_adjacency_first)); + graph->node_adjacency_first[node.idx] = arc; +} + +bool graph_add_arc(struct graph *graph, const struct arc arc, + const struct node from, const struct node to) +{ + assert(from.idx < graph->max_num_nodes); + assert(to.idx < graph->max_num_nodes); + + const struct arc dual = arc_dual(graph, arc); + + if (arc.idx >= graph->max_num_arcs || dual.idx >= graph->max_num_arcs) + return false; + + graph_push_outbound_arc(graph, arc, from); + graph_push_outbound_arc(graph, dual, to); + + return true; +} + +struct graph *graph_new(const tal_t *ctx, const size_t max_num_nodes, + const size_t max_num_arcs, const size_t arc_dual_bit) +{ + struct graph *graph; + graph = tal(ctx, struct graph); + + /* bad allocation of graph */ + if (!graph) + return graph; + + graph->max_num_arcs = max_num_arcs; + graph->max_num_nodes = max_num_nodes; + graph->arc_dual_bit = arc_dual_bit; + + graph->arc_tail = tal_arr(graph, struct node, graph->max_num_arcs); + graph->node_adjacency_first = + tal_arr(graph, struct arc, graph->max_num_nodes); + graph->node_adjacency_next = + tal_arr(graph, struct arc, graph->max_num_arcs); + + /* bad allocation of graph components */ + if (!graph->arc_tail || !graph->node_adjacency_first || + !graph->node_adjacency_next) { + return tal_free(graph); + } + + /* initialize with invalid indexes so that we know these slots have + * never been used, eg. arc/node is newly created */ + for (size_t i = 0; i < graph->max_num_arcs; i++) + graph->arc_tail[i] = node_obj(INVALID_INDEX); + for (size_t i = 0; i < graph->max_num_nodes; i++) + graph->node_adjacency_first[i] = arc_obj(INVALID_INDEX); + for (size_t i = 0; i < graph->max_num_nodes; i++) + graph->node_adjacency_next[i] = arc_obj(INVALID_INDEX); + + return graph; +} diff --git a/plugins/askrene/graph.h b/plugins/askrene/graph.h new file mode 100644 index 000000000000..512f6b5fe3e5 --- /dev/null +++ b/plugins/askrene/graph.h @@ -0,0 +1,165 @@ +#ifndef LIGHTNING_PLUGINS_ASKRENE_GRAPH_H +#define LIGHTNING_PLUGINS_ASKRENE_GRAPH_H + +/* Solves a Minimum Cost Flow with arc selection costs and side constraints. */ + +#include "config.h" +#include +#include +#include + +#define INVALID_INDEX 0xffffffff + +/* A directed arc in a graph. + * It is a simple data object for typesafey. */ +struct arc { + /* arc's index */ + u32 idx; +}; + +/* A node in a graph. + * It is a simple data object for typesafety. */ +struct node { + /* node's index */ + u32 idx; +}; + +static inline struct arc arc_obj(u32 index) +{ + struct arc arc = {.idx = index}; + return arc; +} +static inline struct node node_obj(u32 index) +{ + struct node node = {.idx = index}; + return node; +} + +/* A graph's topology. */ +struct graph { + /* Every arc emanates from a node, the tail. + * The head of the arc is the tail of the dual. */ + struct node *arc_tail; + + /* Adjacency data for nodes. Used to move in a graph in the direction of + * the arcs by looping over all arcs that exit a node. + * + * For every directed arc there is a dual in the opposite direction, + * therefore we can use the same adjacency information to traverse in + * the head to tails direction as well. */ + struct arc *node_adjacency_next; + struct arc *node_adjacency_first; + + size_t max_num_arcs, max_num_nodes; + + /* Bit that must be flipped to obtain the dual of an arc. */ + size_t arc_dual_bit; +}; + +////////////////////////////////////////////////////////////////////////////// + +static inline size_t graph_max_num_arcs(const struct graph *graph) +{ + return graph->max_num_arcs; +} +static inline size_t graph_max_num_nodes(const struct graph *graph) +{ + return graph->max_num_nodes; +} + +/* Give me the dual of an arc. */ +static inline struct arc arc_dual(const struct graph *graph, struct arc arc) +{ + arc.idx ^= (1U << graph->arc_dual_bit); + return arc; +} + +/* Is this arc a dual? */ +static inline bool arc_is_dual(const struct graph *graph, struct arc arc) +{ + return (arc.idx & (1U << graph->arc_dual_bit)) != 0; +} + +/* Give me the node at the tail of an arc. */ +static inline struct node arc_tail(const struct graph *graph, + const struct arc arc) +{ + assert(arc.idx < tal_count(graph->arc_tail)); + return graph->arc_tail[arc.idx]; +} + +/* Give me the node at the head of an arc. */ +static inline struct node arc_head(const struct graph *graph, + const struct arc arc) +{ + const struct arc dual = arc_dual(graph, arc); + assert(dual.idx < tal_count(graph->arc_tail)); + return graph->arc_tail[dual.idx]; +} + +/* Used to loop over the arcs that exit a node. + * + * for example: + * + * void show(struct graph *graph, struct node node) { + * printf("Showing node %" PRIu32 "\n", node.idx); + * for (struct arc arc = node_adjacency_begin(graph, node); + * !node_adjacency_end(arc); + * arc = node_adjacency_next(graph, arc)) { + * printf("arc id: %" PRIu32 ", (%" PRIu32 " -> %" PRIu32 ")\n", + * arc.idx, + * arc_tail(graph, arc).idx, + * arc_head(graph, arc).idx); + * } + * } + * */ +static inline struct arc node_adjacency_begin(const struct graph *graph, + const struct node node) +{ + assert(node.idx < tal_count(graph->node_adjacency_first)); + return graph->node_adjacency_first[node.idx]; +} +static inline bool node_adjacency_end(const struct arc arc) +{ + return arc.idx == INVALID_INDEX; +} +static inline struct arc node_adjacency_next(const struct graph *graph, + const struct arc arc) +{ + assert(arc.idx < tal_count(graph->node_adjacency_next)); + return graph->node_adjacency_next[arc.idx]; +} + +/* Used to loop over the arcs that enter a node. */ +static inline struct arc node_rev_adjacency_begin(const struct graph *graph, + const struct node node) +{ + return arc_dual(graph, node_adjacency_begin(graph, node)); +} +static inline bool node_rev_adjacency_end(const struct arc arc) +{ + return arc.idx == INVALID_INDEX; +} +static inline struct arc node_rev_adjacency_next(const struct graph *graph, + const struct arc arc) +{ + return arc_dual(graph, + node_adjacency_next(graph, arc_dual(graph, arc))); +} + +/* This call adds an arc to the graph, it adds also the dual automatically. + * An arc cannot be added twice, if the caller tries to do add the same arc + * twice the second call is ignored. + * The call fails if the arc or its dual do not fit into max_num_arcs. */ +bool graph_add_arc(struct graph *graph, const struct arc arc, + const struct node from, const struct node to); + +/* Creates a graph object. Nodes and arcs are indexed from 0 to max_num_nodes-1 + * and max_num_arcs-1 respectively. The max_num_arcs should be big enough to + * accomodate also the dual arcs, ie. if the maximum index for a problem arc is + * I then Idual = I^(1< +#include +#include +#include +#include +#include + +#include "../graph.c" + +#define MAX_NODES 10 +#define MAX_ARCS 256 +#define DUAL_BIT 7 + +static void show(struct graph *graph, struct node node) +{ + printf("Showing node %" PRIu32 "\n", node.idx); + for (struct arc arc = node_adjacency_begin(graph, node); + !node_adjacency_end(arc); arc = node_adjacency_next(graph, arc)) { + printf("arc id: %" PRIu32 ", (%" PRIu32 " -> %" PRIu32 ")\n", + arc.idx, arc_tail(graph, arc).idx, + arc_head(graph, arc).idx); + } + printf("\n"); +} + +int main(int argc, char *argv[]) +{ + common_setup(argv[0]); + printf("Allocating a memory context\n"); + tal_t *ctx = tal(NULL, tal_t); + assert(ctx); + + printf("Allocating a graph\n"); + struct graph *graph = graph_new(ctx, MAX_NODES, MAX_ARCS, DUAL_BIT); + assert(graph); + + bool success; + + success = graph_add_arc(graph, arc_obj(0), node_obj(0), node_obj(1)); + assert(success); + + success = graph_add_arc(graph, arc_obj(1), node_obj(0), node_obj(2)); + assert(success); + + success = graph_add_arc(graph, arc_obj(2), node_obj(0), node_obj(3)); + assert(success); + + success = graph_add_arc(graph, arc_obj(3), node_obj(3), node_obj(2)); + assert(success); + + show(graph, node_obj(0)); + show(graph, node_obj(1)); + show(graph, node_obj(2)); + show(graph, node_obj(3)); + + printf("Freeing memory\n"); + ctx = tal_free(ctx); + common_shutdown(); +} + From a2ecd4d6a105e0484da5c3c52e95b41ff43c6ee3 Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Tue, 15 Oct 2024 15:36:47 +0100 Subject: [PATCH 02/23] askrene: add priorityqueue It is just a copy-paste of "dijkstra" but the name implies what it actually is. Not an implementation of minimum cost path Dijkstra algorithm, but a helper data structure. I keep the old "dijkstra.h/c" files for the moment to avoid breaking the current code. Changelog-EXPERIMENTAL: askrene: add priorityqueue Signed-off-by: Lagrang3 --- plugins/askrene/Makefile | 26 ++++- plugins/askrene/priorityqueue.c | 151 ++++++++++++++++++++++++++++++ plugins/askrene/priorityqueue.h | 35 +++++++ plugins/askrene/test/run-pqueue.c | 104 ++++++++++++++++++++ 4 files changed, 314 insertions(+), 2 deletions(-) create mode 100644 plugins/askrene/priorityqueue.c create mode 100644 plugins/askrene/priorityqueue.h create mode 100644 plugins/askrene/test/run-pqueue.c diff --git a/plugins/askrene/Makefile b/plugins/askrene/Makefile index 883dfb9c6caf..88d04e844635 100644 --- a/plugins/askrene/Makefile +++ b/plugins/askrene/Makefile @@ -1,5 +1,27 @@ -PLUGIN_ASKRENE_SRC := plugins/askrene/askrene.c plugins/askrene/layer.c plugins/askrene/reserve.c plugins/askrene/mcf.c plugins/askrene/dijkstra.c plugins/askrene/flow.c plugins/askrene/refine.c plugins/askrene/explain_failure.c plugins/askrene/graph.c -PLUGIN_ASKRENE_HEADER := plugins/askrene/askrene.h plugins/askrene/layer.h plugins/askrene/reserve.h plugins/askrene/mcf.h plugins/askrene/dijkstra.h plugins/askrene/flow.h plugins/askrene/refine.h plugins/askrene/explain_failure.h plugins/askrene/graph.h +PLUGIN_ASKRENE_SRC := \ + plugins/askrene/askrene.c \ + plugins/askrene/layer.c \ + plugins/askrene/reserve.c \ + plugins/askrene/mcf.c \ + plugins/askrene/dijkstra.c \ + plugins/askrene/flow.c \ + plugins/askrene/refine.c \ + plugins/askrene/explain_failure.c \ + plugins/askrene/graph.c \ + plugins/askrene/priorityqueue.c + +PLUGIN_ASKRENE_HEADER := \ + plugins/askrene/askrene.h \ + plugins/askrene/layer.h \ + plugins/askrene/reserve.h \ + plugins/askrene/mcf.h \ + plugins/askrene/dijkstra.h \ + plugins/askrene/flow.h \ + plugins/askrene/refine.h \ + plugins/askrene/explain_failure.h \ + plugins/askrene/graph.h \ + plugins/askrene/priorityqueue.h + PLUGIN_ASKRENE_OBJS := $(PLUGIN_ASKRENE_SRC:.c=.o) $(PLUGIN_ASKRENE_OBJS): $(PLUGIN_ASKRENE_HEADER) diff --git a/plugins/askrene/priorityqueue.c b/plugins/askrene/priorityqueue.c new file mode 100644 index 000000000000..7f0a96cca699 --- /dev/null +++ b/plugins/askrene/priorityqueue.c @@ -0,0 +1,151 @@ +#define NDEBUG 1 +#include "config.h" +#include + +/* priorityqueue: a data structure for pairs (key, value) with + * 0<=key, rather than <. */ +static int priorityqueue_less_comparer(const void *const ctx UNUSED, + const void *const a, + const void *const b) { + return global_priorityqueue->value[*(u32 *)a] > + global_priorityqueue->value[*(u32 *)b]; +} + +/* The heap move operator for priorityqueue search. */ +static void priorityqueue_item_mover(void *const dst, const void *const src) { + u32 src_idx = *(u32 *)src; + *(u32 *)dst = src_idx; + + /* we keep track of the pointer position of each element in the heap, + * for easy update. */ + global_priorityqueue->heapptr[src_idx] = dst; +} + +/* Allocation of resources for the heap. */ +struct priorityqueue *priorityqueue_new(const tal_t *ctx, + size_t max_num_nodes) { + struct priorityqueue *q = tal(ctx, struct priorityqueue); + /* check allocation */ + if (!q) return NULL; + + q->value = tal_arr(q, s64, max_num_nodes); + q->base = tal_arr(q, u32, max_num_nodes); + q->heapptr = tal_arrz(q, u32 *, max_num_nodes); + + /* check allocation */ + if (!q->value || !q->base || !q->heapptr) return tal_free(q); + + q->heapsize = 0; + q->gheap_ctx.fanout = 2; + q->gheap_ctx.page_chunks = 1024; + q->gheap_ctx.item_size = sizeof(q->base[0]); + q->gheap_ctx.less_comparer = priorityqueue_less_comparer; + q->gheap_ctx.less_comparer_ctx = NULL; + q->gheap_ctx.item_mover = priorityqueue_item_mover; + return q; +} + +void priorityqueue_init(struct priorityqueue *q) { + const size_t max_num_nodes = tal_count(q->value); + q->heapsize = 0; + for (size_t i = 0; i < max_num_nodes; ++i) { + q->value[i] = INFINITE; + q->heapptr[i] = NULL; + } +} +size_t priorityqueue_size(const struct priorityqueue *q) { return q->heapsize; } + +size_t priorityqueue_maxsize(const struct priorityqueue *q) { + return tal_count(q->value); +} + +static void priorityqueue_append(struct priorityqueue *q, u32 key, s64 value) { + assert(priorityqueue_size(q) < priorityqueue_maxsize(q)); + assert(key < priorityqueue_maxsize(q)); + + const size_t pos = q->heapsize; + + q->base[pos] = key; + q->value[key] = value; + q->heapptr[key] = &(q->base[pos]); + q->heapsize++; +} + +void priorityqueue_update(struct priorityqueue *q, u32 key, s64 value) { + assert(key < priorityqueue_maxsize(q)); + + if (!q->heapptr[key]) { + /* not in the heap */ + priorityqueue_append(q, key, value); + global_priorityqueue = q; + gheap_restore_heap_after_item_increase( + &q->gheap_ctx, q->base, q->heapsize, + q->heapptr[key] - q->base); + global_priorityqueue = NULL; + return; + } + + if (q->value[key] > value) { + /* value decrease */ + q->value[key] = value; + + global_priorityqueue = q; + gheap_restore_heap_after_item_increase( + &q->gheap_ctx, q->base, q->heapsize, + q->heapptr[key] - q->base); + global_priorityqueue = NULL; + } else { + /* value increase */ + q->value[key] = value; + + global_priorityqueue = q; + gheap_restore_heap_after_item_decrease( + &q->gheap_ctx, q->base, q->heapsize, + q->heapptr[key] - q->base); + global_priorityqueue = NULL; + } + /* assert(gheap_is_heap(&q->gheap_ctx, + * q->base, + * priorityqueue_size())); */ +} + +u32 priorityqueue_top(const struct priorityqueue *q) { + assert(!priorityqueue_empty(q)); + return q->base[0]; +} + +bool priorityqueue_empty(const struct priorityqueue *q) { + return q->heapsize == 0; +} + +void priorityqueue_pop(struct priorityqueue *q) { + if (q->heapsize == 0) return; + + const u32 top = priorityqueue_top(q); + assert(q->heapptr[top] == q->base); + + global_priorityqueue = q; + gheap_pop_heap(&q->gheap_ctx, q->base, q->heapsize--); + global_priorityqueue = NULL; + q->heapptr[top] = NULL; +} + +const s64 *priorityqueue_value(const struct priorityqueue *q) { + return q->value; +} diff --git a/plugins/askrene/priorityqueue.h b/plugins/askrene/priorityqueue.h new file mode 100644 index 000000000000..42d01cc58048 --- /dev/null +++ b/plugins/askrene/priorityqueue.h @@ -0,0 +1,35 @@ +#ifndef LIGHTNING_PLUGINS_ASKRENE_PRIORITYQUEUE_H +#define LIGHTNING_PLUGINS_ASKRENE_PRIORITYQUEUE_H + +/* Defines a priority queue using gheap. */ + +#include "config.h" +#include +#include +#include + +/* Allocation of resources for the heap. */ +struct priorityqueue *priorityqueue_new(const tal_t *ctx, + size_t max_num_elements); + +/* Initialization of the heap for a new priorityqueue search. */ +void priorityqueue_init(struct priorityqueue *priorityqueue); + +/* Inserts a new element in the heap. If node_idx was already in the heap then + * its value is updated. */ +void priorityqueue_update(struct priorityqueue *priorityqueue, u32 key, + s64 value); + +u32 priorityqueue_top(const struct priorityqueue *priorityqueue); +bool priorityqueue_empty(const struct priorityqueue *priorityqueue); +void priorityqueue_pop(struct priorityqueue *priorityqueue); + +const s64 *priorityqueue_value(const struct priorityqueue *priorityqueue); + +/* Number of elements on the heap. */ +size_t priorityqueue_size(const struct priorityqueue *priorityqueue); + +/* Maximum number of elements the heap can host */ +size_t priorityqueue_maxsize(const struct priorityqueue *priorityqueue); + +#endif /* LIGHTNING_PLUGINS_ASKRENE_PRIORITYQUEUE_H */ diff --git a/plugins/askrene/test/run-pqueue.c b/plugins/askrene/test/run-pqueue.c new file mode 100644 index 000000000000..b2fe1d2a14fc --- /dev/null +++ b/plugins/askrene/test/run-pqueue.c @@ -0,0 +1,104 @@ +#include "config.h" +#include +#include +#include +#include +#include + + +#include "../priorityqueue.c" + +#define CHECK(arg) if(!(arg)){fprintf(stderr, "failed CHECK at line %d: %s\n", __LINE__, #arg); abort();} + +static void priorityqueue_show(struct priorityqueue *q) +{ + printf("size of queue: %zu\n", priorityqueue_size(q)); + printf("empty?: %s\n", priorityqueue_empty(q) ? "true" : "false"); + if (!priorityqueue_empty(q)) + printf("top of the queue: %" PRIu32 "\n", priorityqueue_top(q)); + const s64 *value = priorityqueue_value(q); + for (u32 i = 0; i < priorityqueue_maxsize(q); i++) { + printf("(%" PRIu32 ", %" PRIi64 ")", i, value[i]); + } + + printf("\n\n"); +} + +int main(int argc, char *argv[]) +{ + common_setup(argv[0]); + printf("Hello world!\n"); + + printf("Allocating a memory context\n"); + tal_t *ctx = tal(NULL, tal_t); + CHECK(ctx); + + printf("Allocating a priorityqueue\n"); + struct priorityqueue *q; + q = priorityqueue_new(ctx, 5); + CHECK(q); + + /* reset all values */ + priorityqueue_init(q); + priorityqueue_show(q); + CHECK(priorityqueue_empty(q)); + CHECK(priorityqueue_size(q)==0); + + priorityqueue_update(q, 0, 10); + priorityqueue_show(q); + CHECK(!priorityqueue_empty(q)); + CHECK(priorityqueue_size(q)==1); + CHECK(priorityqueue_top(q)==0); + + priorityqueue_update(q, 0, 3); + priorityqueue_show(q); + CHECK(!priorityqueue_empty(q)); + CHECK(priorityqueue_size(q)==1); + CHECK(priorityqueue_top(q)==0); + + priorityqueue_update(q, 1, 3); + priorityqueue_show(q); + CHECK(!priorityqueue_empty(q)); + CHECK(priorityqueue_size(q)==2); + // CHECK(priorityqueue_top(q)==0); + + priorityqueue_update(q, 1, 5); + priorityqueue_show(q); + CHECK(!priorityqueue_empty(q)); + CHECK(priorityqueue_size(q)==2); + CHECK(priorityqueue_top(q)==0); + + priorityqueue_update(q, 1, -1); + priorityqueue_show(q); + CHECK(!priorityqueue_empty(q)); + CHECK(priorityqueue_size(q)==2); + CHECK(priorityqueue_top(q)==1); + + priorityqueue_pop(q); + priorityqueue_show(q); + CHECK(!priorityqueue_empty(q)); + CHECK(priorityqueue_size(q)==1); + CHECK(priorityqueue_top(q)==0); + + priorityqueue_update(q, 1, 0); + priorityqueue_show(q); + CHECK(!priorityqueue_empty(q)); + CHECK(priorityqueue_size(q)==2); + CHECK(priorityqueue_top(q)==1); + + priorityqueue_update(q, 4, -10); + priorityqueue_show(q); + CHECK(!priorityqueue_empty(q)); + CHECK(priorityqueue_size(q)==3); + CHECK(priorityqueue_top(q)==4); + + priorityqueue_pop(q); + priorityqueue_show(q); + CHECK(!priorityqueue_empty(q)); + CHECK(priorityqueue_size(q)==2); + CHECK(priorityqueue_top(q)==1); + + printf("Freeing memory\n"); + ctx = tal_free(ctx); + common_shutdown(); +} From 78a1583ecd5c8a12ea5a284201f451042801e0f9 Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Wed, 16 Oct 2024 08:17:20 +0100 Subject: [PATCH 03/23] askrene: add graph algorithms module Changelog-EXPERIMENTAL: askrene: add graph algorithms module Signed-off-by: Lagrang3 --- plugins/askrene/Makefile | 6 +- plugins/askrene/algorithm.c | 79 +++++++++++++++++++++++ plugins/askrene/algorithm.h | 36 +++++++++++ plugins/askrene/graph.h | 2 +- plugins/askrene/test/Makefile | 4 ++ plugins/askrene/test/run-bfs.c | 100 ++++++++++++++++++++++++++++++ plugins/askrene/test/run-graph.c | 1 + plugins/askrene/test/run-pqueue.c | 1 + 8 files changed, 226 insertions(+), 3 deletions(-) create mode 100644 plugins/askrene/algorithm.c create mode 100644 plugins/askrene/algorithm.h create mode 100644 plugins/askrene/test/run-bfs.c diff --git a/plugins/askrene/Makefile b/plugins/askrene/Makefile index 88d04e844635..a34442df4b27 100644 --- a/plugins/askrene/Makefile +++ b/plugins/askrene/Makefile @@ -8,7 +8,8 @@ PLUGIN_ASKRENE_SRC := \ plugins/askrene/refine.c \ plugins/askrene/explain_failure.c \ plugins/askrene/graph.c \ - plugins/askrene/priorityqueue.c + plugins/askrene/priorityqueue.c \ + plugins/askrene/algorithm.c PLUGIN_ASKRENE_HEADER := \ plugins/askrene/askrene.h \ @@ -20,7 +21,8 @@ PLUGIN_ASKRENE_HEADER := \ plugins/askrene/refine.h \ plugins/askrene/explain_failure.h \ plugins/askrene/graph.h \ - plugins/askrene/priorityqueue.h + plugins/askrene/priorityqueue.h \ + plugins/askrene/algorithm.h PLUGIN_ASKRENE_OBJS := $(PLUGIN_ASKRENE_SRC:.c=.o) diff --git a/plugins/askrene/algorithm.c b/plugins/askrene/algorithm.c new file mode 100644 index 000000000000..50a4f2565df6 --- /dev/null +++ b/plugins/askrene/algorithm.c @@ -0,0 +1,79 @@ +#include "config.h" +#include +#include +#include +#include +#include + +#define MAX(x, y) (((x) > (y)) ? (x) : (y)) +#define MIN(x, y) (((x) < (y)) ? (x) : (y)) + +/* Simple queue to traverse the network. */ +struct queue_data { + u32 idx; + struct lqueue_link ql; +}; + +bool BFS_path(const tal_t *ctx, const struct graph *graph, + const struct node source, const struct node destination, + const s64 *capacity, const s64 cap_threshold, struct arc *prev) +{ + tal_t *this_ctx = tal(ctx, tal_t); + bool target_found = false; + const size_t max_num_arcs = graph_max_num_arcs(graph); + const size_t max_num_nodes = graph_max_num_nodes(graph); + + /* check preconditions */ + if (!graph || source.idx >= max_num_nodes || !capacity || !prev) + goto finish; + + if (tal_count(capacity) != max_num_arcs || + tal_count(prev) != max_num_nodes) + goto finish; + + for (size_t i = 0; i < max_num_nodes; i++) + prev[i].idx = INVALID_INDEX; + + LQUEUE(struct queue_data, ql) myqueue = LQUEUE_INIT; + struct queue_data *qdata; + + qdata = tal(this_ctx, struct queue_data); + qdata->idx = source.idx; + lqueue_enqueue(&myqueue, qdata); + + while (!lqueue_empty(&myqueue)) { + qdata = lqueue_dequeue(&myqueue); + struct node cur = {.idx = qdata->idx}; + + tal_free(qdata); + + if (cur.idx == destination.idx) { + target_found = true; + break; + } + + for (struct arc arc = node_adjacency_begin(graph, cur); + !node_adjacency_end(arc); + arc = node_adjacency_next(graph, arc)) { + /* check if this arc is traversable */ + if (capacity[arc.idx] < cap_threshold) + continue; + + const struct node next = arc_head(graph, arc); + + /* if that node has been seen previously */ + if (prev[next.idx].idx != INVALID_INDEX) + continue; + + prev[next.idx] = arc; + + qdata = tal(this_ctx, struct queue_data); + qdata->idx = next.idx; + lqueue_enqueue(&myqueue, qdata); + } + } + +finish: + tal_free(this_ctx); + return target_found; +} diff --git a/plugins/askrene/algorithm.h b/plugins/askrene/algorithm.h new file mode 100644 index 000000000000..750e69163f13 --- /dev/null +++ b/plugins/askrene/algorithm.h @@ -0,0 +1,36 @@ +#ifndef LIGHTNING_PLUGINS_ASKRENE_ALGORITHM_H +#define LIGHTNING_PLUGINS_ASKRENE_ALGORITHM_H + +/* Implementation of network algorithms: shortests path, minimum cost flow, etc. + */ + +#include "config.h" +#include + +/* Search any path from source to destination using Breadth First Search. + * + * input: + * @ctx: tal allocator, + * @graph: graph of the network, + * @source: source node, + * @destination: destination node, + * @capacity: arcs capacity + * @cap_threshold: an arc i is traversable if capacity[i]>=cap_threshold + * + * output: + * @prev: prev[i] is the arc that leads to node i for an optimal solution, it + * @return: true if the destination node was reached. + * + * precondition: + * |capacity|=graph_max_num_arcs + * |prev|=graph_max_num_nodes + * + * The destination is only used as a stopping condition, if destination is + * passed with an invalid idx then the algorithm will produce a discovery tree + * of all reacheable nodes from the source. + * */ +bool BFS_path(const tal_t *ctx, const struct graph *graph, + const struct node source, const struct node destination, + const s64 *capacity, const s64 cap_threshold, struct arc *prev); + +#endif /* LIGHTNING_PLUGINS_ASKRENE_ALGORITHM_H */ diff --git a/plugins/askrene/graph.h b/plugins/askrene/graph.h index 512f6b5fe3e5..c21b1f7ac810 100644 --- a/plugins/askrene/graph.h +++ b/plugins/askrene/graph.h @@ -1,7 +1,7 @@ #ifndef LIGHTNING_PLUGINS_ASKRENE_GRAPH_H #define LIGHTNING_PLUGINS_ASKRENE_GRAPH_H -/* Solves a Minimum Cost Flow with arc selection costs and side constraints. */ +/* Defines a graph data structure. */ #include "config.h" #include diff --git a/plugins/askrene/test/Makefile b/plugins/askrene/test/Makefile index fba2108228a2..ced945fca602 100644 --- a/plugins/askrene/test/Makefile +++ b/plugins/askrene/test/Makefile @@ -10,6 +10,10 @@ $(PLUGIN_RENEPAY_TEST_OBJS): $(PLUGIN_ASKRENE_SRC) PLUGIN_ASKRENE_TEST_COMMON_OBJS := +plugins/askrene/test/run-bfs: \ + plugins/askrene/priorityqueue.o \ + plugins/askrene/graph.o + $(PLUGIN_ASKRENE_TEST_PROGRAMS): $(PLUGIN_ASKRENE_TEST_COMMON_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS) $(CCAN_OBJS) check-askrene: $(PLUGIN_ASKRENE_TEST_PROGRAMS:%=unittest/%) diff --git a/plugins/askrene/test/run-bfs.c b/plugins/askrene/test/run-bfs.c new file mode 100644 index 000000000000..529ff5832448 --- /dev/null +++ b/plugins/askrene/test/run-bfs.c @@ -0,0 +1,100 @@ +#include "config.h" +#include +#include +#include +#include +#include +#include + +#include "../algorithm.c" + +#define MAX_NODES 256 +#define MAX_ARCS 256 +#define DUAL_BIT 7 + +#define CHECK(arg) if(!(arg)){fprintf(stderr, "failed CHECK at line %d: %s\n", __LINE__, #arg); abort();} + +static void show(struct graph *graph, struct node node) +{ + printf("Showing node %" PRIu32 "\n", node.idx); + for (struct arc arc = node_adjacency_begin(graph, node); + !node_adjacency_end(arc); arc = node_adjacency_next(graph, arc)) { + printf("arc id: %" PRIu32 ", (%" PRIu32 " -> %" PRIu32 ")\n", + arc.idx, arc_tail(graph, arc).idx, + arc_head(graph, arc).idx); + } + printf("\n"); +} + +int main(int argc, char *argv[]) +{ + common_setup(argv[0]); + printf("Allocating a memory context\n"); + tal_t *ctx = tal(NULL, tal_t); + assert(ctx); + + printf("Allocating a graph\n"); + struct graph *graph = graph_new(ctx, MAX_NODES, MAX_ARCS, DUAL_BIT); + assert(graph); + + s64 *capacity = tal_arrz(ctx, s64, MAX_ARCS); + struct arc *prev = tal_arr(ctx, struct arc, MAX_NODES); + + graph_add_arc(graph, arc_obj(0), node_obj(1), node_obj(2)); + capacity[0] = 1; + graph_add_arc(graph, arc_obj(1), node_obj(1), node_obj(3)); + capacity[1] = 1; + graph_add_arc(graph, arc_obj(2), node_obj(1), node_obj(6)); + capacity[2] = 1; + graph_add_arc(graph, arc_obj(3), node_obj(2), node_obj(3)); + capacity[3] = 1; + graph_add_arc(graph, arc_obj(4), node_obj(2), node_obj(4)); + capacity[4] = 0; /* disable this arc */ + graph_add_arc(graph, arc_obj(5), node_obj(3), node_obj(4)); + capacity[5] = 1; + graph_add_arc(graph, arc_obj(6), node_obj(3), node_obj(6)); + capacity[6] = 1; + graph_add_arc(graph, arc_obj(7), node_obj(4), node_obj(5)); + capacity[7] = 1; + graph_add_arc(graph, arc_obj(8), node_obj(5), node_obj(6)); + capacity[8] = 1; + + show(graph, node_obj(1)); + show(graph, node_obj(2)); + show(graph, node_obj(3)); + show(graph, node_obj(4)); + show(graph, node_obj(5)); + show(graph, node_obj(6)); + + struct node src = {.idx = 1}; + struct node dst = {.idx = 5}; + + bool result = BFS_path(ctx, graph, src, dst, capacity, 1, prev); + assert(result); + + int pathlen = 0; + int arc_sequence[] = {7, 5, 1}; + int node_sequence[] = {4, 3, 1}; + + printf("path: "); + for (struct node cur = dst; cur.idx != src.idx;) { + struct arc arc = prev[cur.idx]; + printf("node(%" PRIu32 ") arc(%" PRIu32 ") - ", cur.idx, + arc.idx); + cur = arc_tail(graph, arc); + CHECK(pathlen < 3); + CHECK(cur.idx == node_sequence[pathlen]); + CHECK(arc.idx == arc_sequence[pathlen]); + pathlen ++; + } + CHECK(pathlen == 3); + printf("node(%" PRIu32 ") arc(NONE)\n", src.idx); + printf("path length: %d\n", pathlen); + + printf("Freeing memory\n"); + ctx = tal_free(ctx); + + common_shutdown(); + return 0; +} + diff --git a/plugins/askrene/test/run-graph.c b/plugins/askrene/test/run-graph.c index e9644ff076de..3c6d4c945ec5 100644 --- a/plugins/askrene/test/run-graph.c +++ b/plugins/askrene/test/run-graph.c @@ -57,5 +57,6 @@ int main(int argc, char *argv[]) printf("Freeing memory\n"); ctx = tal_free(ctx); common_shutdown(); + return 0; } diff --git a/plugins/askrene/test/run-pqueue.c b/plugins/askrene/test/run-pqueue.c index b2fe1d2a14fc..a6f8e2454cd8 100644 --- a/plugins/askrene/test/run-pqueue.c +++ b/plugins/askrene/test/run-pqueue.c @@ -101,4 +101,5 @@ int main(int argc, char *argv[]) printf("Freeing memory\n"); ctx = tal_free(ctx); common_shutdown(); + return 0; } From 15c337702a19cb98f0354cac62cf2f8504a740d8 Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Wed, 16 Oct 2024 08:54:46 +0100 Subject: [PATCH 04/23] askrene: add dijkstra algorithm Changelog-EXPERIMENTAL: askrene: add dijkstra algorithm Signed-off-by: Lagrang3 --- plugins/askrene/algorithm.c | 92 +++++++++++++++++++++ plugins/askrene/algorithm.h | 36 +++++++++ plugins/askrene/test/Makefile | 2 +- plugins/askrene/test/run-dijkstra.c | 121 ++++++++++++++++++++++++++++ 4 files changed, 250 insertions(+), 1 deletion(-) create mode 100644 plugins/askrene/test/run-dijkstra.c diff --git a/plugins/askrene/algorithm.c b/plugins/askrene/algorithm.c index 50a4f2565df6..4b3acc7a8569 100644 --- a/plugins/askrene/algorithm.c +++ b/plugins/askrene/algorithm.c @@ -77,3 +77,95 @@ bool BFS_path(const tal_t *ctx, const struct graph *graph, tal_free(this_ctx); return target_found; } + +bool dijkstra_path(const tal_t *ctx, const struct graph *graph, + const struct node source, const struct node destination, + bool prune, const s64 *capacity, const s64 cap_threshold, + const s64 *cost, const s64 *potential, struct arc *prev, + s64 *distance) +{ + bool target_found = false; + const size_t max_num_arcs = graph_max_num_arcs(graph); + const size_t max_num_nodes = graph_max_num_nodes(graph); + tal_t *this_ctx = tal(ctx, tal_t); + + /* check preconditions */ + if (!graph || source.idx >=max_num_nodes || !cost || !capacity || + !prev || !distance) + goto finish; + + /* if prune is true then the destination cannot be invalid */ + if (destination.idx >=max_num_nodes && prune) + goto finish; + + if (tal_count(cost) != max_num_arcs || + tal_count(capacity) != max_num_arcs || + tal_count(prev) != max_num_nodes || + tal_count(distance) != max_num_nodes) + goto finish; + + /* FIXME: maybe this is unnecessary */ + bitmap *visited = tal_arrz(this_ctx, bitmap, + BITMAP_NWORDS(max_num_nodes)); + + if (!visited) + /* bad allocation */ + goto finish; + + for (size_t i = 0; i < max_num_nodes; ++i) + prev[i].idx = INVALID_INDEX; + + struct priorityqueue *q; + q = priorityqueue_new(this_ctx, max_num_nodes); + const s64 *const dijkstra_distance = priorityqueue_value(q); + + priorityqueue_init(q); + priorityqueue_update(q, source.idx, 0); + + while (!priorityqueue_empty(q)) { + const u32 cur = priorityqueue_top(q); + priorityqueue_pop(q); + + /* FIXME: maybe this is unnecessary */ + if (bitmap_test_bit(visited, cur)) + continue; + bitmap_set_bit(visited, cur); + + if (cur == destination.idx) { + target_found = true; + if (prune) + break; + } + + for (struct arc arc = + node_adjacency_begin(graph, node_obj(cur)); + !node_adjacency_end(arc); + arc = node_adjacency_next(graph, arc)) { + /* check if this arc is traversable */ + if (capacity[arc.idx] < cap_threshold) + continue; + + const struct node next = arc_head(graph, arc); + + const s64 cij = cost[arc.idx] - potential[cur] + + potential[next.idx]; + + /* Dijkstra only works with non-negative weights */ + assert(cij >= 0); + + if (dijkstra_distance[next.idx] <= + dijkstra_distance[cur] + cij) + continue; + + priorityqueue_update(q, next.idx, + dijkstra_distance[cur] + cij); + prev[next.idx] = arc; + } + } + for (size_t i = 0; i < max_num_nodes; i++) + distance[i] = dijkstra_distance[i]; + +finish: + tal_free(this_ctx); + return target_found; +} diff --git a/plugins/askrene/algorithm.h b/plugins/askrene/algorithm.h index 750e69163f13..ec571314cff7 100644 --- a/plugins/askrene/algorithm.h +++ b/plugins/askrene/algorithm.h @@ -33,4 +33,40 @@ bool BFS_path(const tal_t *ctx, const struct graph *graph, const struct node source, const struct node destination, const s64 *capacity, const s64 cap_threshold, struct arc *prev); + +/* Computes the distance from the source to every other node in the network + * using Dijkstra's algorithm. + * + * input: + * @ctx: tal context for internal allocation + * @graph: topological information of the graph + * @source: source node + * @destination: destination node + * @prune: if prune is true the algorithm stops when the optimal path is found + * for the destination node + * @capacity: arcs capacity + * @cap_threshold: an arc i is traversable if capacity[i]>=cap_threshold + * @cost: arc's cost + * @potential: nodes' potential, ie. reduced cost for an arc + * c_ij = cost_ij - potential[i] + potential[j] + * + * output: + * @prev: for each node, this is the arc that was used to arrive to it, this can + * be used to reconstruct the path from the destination to the source, + * @distance: node's best distance + * returns true if an optimal path is found for the destination, false otherwise + * + * precondition: + * |capacity|=|cost|=graph_max_num_arcs + * |prev|=|distance|=graph_max_num_nodes + * cost[i]>=0 + * if prune is true the destination must be valid + * */ +bool dijkstra_path(const tal_t *ctx, const struct graph *graph, + const struct node source, const struct node destination, + bool prune, const s64 *capacity, const s64 cap_threshold, + const s64 *cost, const s64 *potential, struct arc *prev, + s64 *distance); + + #endif /* LIGHTNING_PLUGINS_ASKRENE_ALGORITHM_H */ diff --git a/plugins/askrene/test/Makefile b/plugins/askrene/test/Makefile index ced945fca602..1e1231949366 100644 --- a/plugins/askrene/test/Makefile +++ b/plugins/askrene/test/Makefile @@ -10,7 +10,7 @@ $(PLUGIN_RENEPAY_TEST_OBJS): $(PLUGIN_ASKRENE_SRC) PLUGIN_ASKRENE_TEST_COMMON_OBJS := -plugins/askrene/test/run-bfs: \ +plugins/askrene/test/run-bfs plugins/askrene/test/run-dijkstra: \ plugins/askrene/priorityqueue.o \ plugins/askrene/graph.o diff --git a/plugins/askrene/test/run-dijkstra.c b/plugins/askrene/test/run-dijkstra.c new file mode 100644 index 000000000000..4c2e9cd39b12 --- /dev/null +++ b/plugins/askrene/test/run-dijkstra.c @@ -0,0 +1,121 @@ +#include "config.h" +#include +#include +#include +#include +#include +#include + +#include "../algorithm.c" + +// 1->2 7 +// 1->3 9 +// 1->6 14 +// 2->3 10 +// 2->4 15 +// 3->6 2 +// 3->4 11 +// 4->5 6 +// 5->6 9 + +#define MAX_NODES 256 +#define MAX_ARCS 256 +#define DUAL_BIT 7 + +#define CHECK(arg) if(!(arg)){fprintf(stderr, "failed CHECK at line %d: %s\n", __LINE__, #arg); abort();} + +static void show(struct graph *graph, struct node node) +{ + printf("Showing node %" PRIu32 "\n", node.idx); + for (struct arc arc = node_adjacency_begin(graph, node); + !node_adjacency_end(arc); arc = node_adjacency_next(graph, arc)) { + printf("arc id: %" PRIu32 ", (%" PRIu32 " -> %" PRIu32 ")\n", + arc.idx, arc_tail(graph, arc).idx, + arc_head(graph, arc).idx); + } + printf("\n"); +} + +int main(int argc, char *argv[]) +{ + common_setup(argv[0]); + printf("Allocating a memory context\n"); + tal_t *ctx = tal(NULL, tal_t); + assert(ctx); + + printf("Allocating a graph\n"); + struct graph *graph = graph_new(ctx, MAX_NODES, MAX_ARCS, DUAL_BIT); + assert(graph); + + s64 *capacity = tal_arrz(ctx, s64, MAX_ARCS); + s64 *cost = tal_arrz(ctx, s64, MAX_ARCS); + s64 *potential = tal_arrz(ctx, s64, MAX_NODES); + s64 *distance = tal_arr(ctx, s64, MAX_NODES); + struct arc *prev = tal_arr(ctx, struct arc, MAX_NODES); + + graph_add_arc(graph, arc_obj(0), node_obj(1), node_obj(2)); + cost[0] = 7, capacity[0] = 1; + graph_add_arc(graph, arc_obj(1), node_obj(1), node_obj(3)); + cost[1] = 9, capacity[1] = 1; + graph_add_arc(graph, arc_obj(2), node_obj(1), node_obj(6)); + cost[2] = 14, capacity[2] = 1; + graph_add_arc(graph, arc_obj(3), node_obj(2), node_obj(3)); + cost[3] = 10, capacity[3] = 1; + graph_add_arc(graph, arc_obj(4), node_obj(2), node_obj(4)); + cost[4] = 15, capacity[4] = 1; + graph_add_arc(graph, arc_obj(5), node_obj(3), node_obj(4)); + cost[5] = 11, capacity[5] = 1; + graph_add_arc(graph, arc_obj(6), node_obj(3), node_obj(6)); + cost[6] = 2, capacity[6] = 1; + graph_add_arc(graph, arc_obj(7), node_obj(4), node_obj(5)); + cost[7] = 6, capacity[7] = 1; + graph_add_arc(graph, arc_obj(8), node_obj(5), node_obj(6)); + cost[8] = 9, capacity[8] = 1; + + show(graph, node_obj(1)); + show(graph, node_obj(2)); + show(graph, node_obj(3)); + show(graph, node_obj(4)); + show(graph, node_obj(5)); + show(graph, node_obj(6)); + + struct node src = {.idx = 1}; + struct node dst = {.idx = 6}; + + bool result = dijkstra_path(ctx, graph, src, dst, false, capacity, 1, + cost, potential, prev, distance); + CHECK(result); + + int pathlen = 0; + int arc_sequence[] = {6, 1}; + int node_sequence[] = {3, 1}; + + for (struct node cur = dst; cur.idx != src.idx;) { + struct arc arc = prev[cur.idx]; + printf("node(%" PRIu32 ") arc(%" PRIu32 ") - ", cur.idx, + arc.idx); + cur = arc_tail(graph, arc); + CHECK(pathlen < 2); + CHECK(cur.idx == node_sequence[pathlen]); + CHECK(arc.idx == arc_sequence[pathlen]); + pathlen++; + } + CHECK(pathlen == 2); + + for (size_t i = 1; i <= 6; i++) { + printf("node: %zu, distance: %" PRIi64 "\n", i, distance[i]); + } + + CHECK(distance[1] == 0); + CHECK(distance[2] == 7); + CHECK(distance[3] == 9); + CHECK(distance[4] == 20); + CHECK(distance[5] == 26); + CHECK(distance[6] == 11); + + printf("Freeing memory\n"); + ctx = tal_free(ctx); + + common_shutdown(); + return 0; +} From eaca91bbd0c1ed0dc4ed1796962394318d90e20d Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Wed, 16 Oct 2024 14:02:05 +0100 Subject: [PATCH 05/23] askrene: add algorithm to compute feasible flow Changelog-EXPERIMENTAL: askrene: add algorithm to compute feasible flow Signed-off-by: Lagrang3 --- plugins/askrene/algorithm.c | 153 ++++++++++++++++++++++++++++++++ plugins/askrene/algorithm.h | 46 ++++++++++ plugins/askrene/test/Makefile | 2 +- plugins/askrene/test/run-flow.c | 113 +++++++++++++++++++++++ 4 files changed, 313 insertions(+), 1 deletion(-) create mode 100644 plugins/askrene/test/run-flow.c diff --git a/plugins/askrene/algorithm.c b/plugins/askrene/algorithm.c index 4b3acc7a8569..bea80c80a903 100644 --- a/plugins/askrene/algorithm.c +++ b/plugins/askrene/algorithm.c @@ -5,6 +5,8 @@ #include #include +static const s64 INFINITE = INT64_MAX; + #define MAX(x, y) (((x) > (y)) ? (x) : (y)) #define MIN(x, y) (((x) < (y)) ? (x) : (y)) @@ -169,3 +171,154 @@ bool dijkstra_path(const tal_t *ctx, const struct graph *graph, tal_free(this_ctx); return target_found; } + +/* Get the max amount of flow one can send from source to target along the path + * encoded in `prev`. */ +static s64 get_augmenting_flow(const struct graph *graph, + const struct node source, + const struct node target, const s64 *capacity, + const struct arc *prev) +{ + const size_t max_num_nodes = graph_max_num_nodes(graph); + const size_t max_num_arcs = graph_max_num_arcs(graph); + assert(max_num_nodes == tal_count(prev)); + assert(max_num_arcs == tal_count(capacity)); + + /* count the number of arcs in the path */ + int path_length = 0; + s64 flow = INFINITE; + + struct node cur = target; + while (cur.idx != source.idx) { + assert(cur.idx < max_num_nodes); + const struct arc arc = prev[cur.idx]; + assert(arc.idx < max_num_arcs); + flow = MIN(flow, capacity[arc.idx]); + + /* we are traversing in the opposite direction to the flow, + * hence the next node is at the tail of the arc. */ + cur = arc_tail(graph, arc); + + /* We may never have a path exceeds the number of nodes, it this + * happens it means we have an infinite loop. */ + path_length++; + if(path_length >= max_num_nodes){ + flow = -1; + break; + } + } + + assert(flow < INFINITE && flow > 0); + return flow; +} + +/* Augment a `flow` amount along the path defined by `prev`.*/ +static void augment_flow(const struct graph *graph, + const struct node source, + const struct node target, + const struct arc *prev, + s64 *capacity, + s64 flow) +{ + const size_t max_num_nodes = graph_max_num_nodes(graph); + const size_t max_num_arcs = graph_max_num_arcs(graph); + assert(max_num_nodes == tal_count(prev)); + assert(max_num_arcs == tal_count(capacity)); + + struct node cur = target; + /* count the number of arcs in the path */ + int path_length = 0; + + while (cur.idx != source.idx) { + assert(cur.idx < max_num_nodes); + const struct arc arc = prev[cur.idx]; + const struct arc dual = arc_dual(graph, arc); + + assert(arc.idx < max_num_arcs); + assert(dual.idx < max_num_arcs); + + capacity[arc.idx] -= flow; + capacity[dual.idx] += flow; + + assert(capacity[arc.idx] >= 0); + + /* we are traversing in the opposite direction to the flow, + * hence the next node is at the tail of the arc. */ + cur = arc_tail(graph, arc); + + /* We may never have a path exceeds the number of nodes, it this + * happens it means we have an infinite loop. */ + path_length++; + if(path_length >= max_num_nodes) + break; + } + assert(path_length < max_num_nodes); +} + +bool simple_feasibleflow(const tal_t *ctx, + const struct graph *graph, + const struct node source, + const struct node destination, + s64 *capacity, + s64 amount) +{ + tal_t *this_ctx = tal(ctx, tal_t); + const size_t max_num_arcs = graph_max_num_arcs(graph); + const size_t max_num_nodes = graph_max_num_nodes(graph); + + /* check preconditions */ + if (amount < 0) + goto finish; + + if (!graph || source.idx >= max_num_nodes || + destination.idx >= max_num_nodes || !capacity) + goto finish; + + if (tal_count(capacity) != max_num_arcs) + goto finish; + + /* path information + * prev: is the id of the arc that lead to the node. */ + struct arc *prev = tal_arr(this_ctx, struct arc, max_num_nodes); + if (!prev) + goto finish; + + while (amount > 0) { + /* find a path from source to target */ + if (!BFS_path(this_ctx, graph, source, destination, capacity, 1, + prev)) + goto finish; + + /* traverse the path and see how much flow we can send */ + s64 delta = get_augmenting_flow(graph, source, destination, + capacity, prev); + + /* commit that flow to the path */ + delta = MIN(amount, delta); + assert(delta > 0 && delta <= amount); + + augment_flow(graph, source, destination, prev, capacity, delta); + amount -= delta; + } +finish: + tal_free(this_ctx); + return amount == 0; +} + +s64 node_balance(const struct graph *graph, + const struct node node, + const s64 *capacity) +{ + s64 balance = 0; + + for (struct arc arc = node_adjacency_begin(graph, node); + !node_adjacency_end(arc); arc = node_adjacency_next(graph, arc)) { + struct arc dual = arc_dual(graph, arc); + + if (arc_is_dual(graph, arc)) + balance += capacity[arc.idx]; + else + balance -= capacity[dual.idx]; + } + return balance; +} diff --git a/plugins/askrene/algorithm.h b/plugins/askrene/algorithm.h index ec571314cff7..5f13107cb947 100644 --- a/plugins/askrene/algorithm.h +++ b/plugins/askrene/algorithm.h @@ -69,4 +69,50 @@ bool dijkstra_path(const tal_t *ctx, const struct graph *graph, s64 *distance); +/* Finds any flow that satisfy the capacity constraints: + * flow[i] <= capacity[i] + * and supply/demand constraints: + * supply[source] = demand[destination] = amount + * supply/demand[node] = 0 for every other node + * + * It uses simple augmenting paths algorithm. + * + * input: + * @ctx: tal context for internal allocation + * @graph: topological information of the graph + * @source: source node + * @destination: destination node + * @capacity: arcs capacity + * @amount: supply/demand + * + * output: + * @capacity: residual capacity + * returns true if the balance constraint can be satisfied + * + * precondition: + * |capacity|=graph_max_num_arcs + * amount>=0 + * */ +bool simple_feasibleflow(const tal_t *ctx, const struct graph *graph, + const struct node source, + const struct node destination, s64 *capacity, + s64 amount); + + +/* Computes the balance of a node, ie. the incoming flows minus the outgoing. + * + * @graph: topology + * @node: node + * @capacity: capacity in the residual sense, not the constrain capacity + * + * This works because in the adjacency list an arc wich is dual is associated + * with an inconming arc i, then we add this flow, while an arc which is not + * dual corresponds to and outgoing flow that we need to substract. + * The flow on the arc i (not dual) is computed as: + * flow[i] = residual_capacity[i_dual], + * while the constrain capacity is + * capacity[i] = residual_capacity[i] + residual_capacity[i_dual] */ +s64 node_balance(const struct graph *graph, const struct node node, + const s64 *capacity); + #endif /* LIGHTNING_PLUGINS_ASKRENE_ALGORITHM_H */ diff --git a/plugins/askrene/test/Makefile b/plugins/askrene/test/Makefile index 1e1231949366..6b414fc62d2d 100644 --- a/plugins/askrene/test/Makefile +++ b/plugins/askrene/test/Makefile @@ -10,7 +10,7 @@ $(PLUGIN_RENEPAY_TEST_OBJS): $(PLUGIN_ASKRENE_SRC) PLUGIN_ASKRENE_TEST_COMMON_OBJS := -plugins/askrene/test/run-bfs plugins/askrene/test/run-dijkstra: \ +plugins/askrene/test/run-bfs plugins/askrene/test/run-dijkstra plugins/askrene/test/run-flow: \ plugins/askrene/priorityqueue.o \ plugins/askrene/graph.o diff --git a/plugins/askrene/test/run-flow.c b/plugins/askrene/test/run-flow.c new file mode 100644 index 000000000000..ead35db7c8df --- /dev/null +++ b/plugins/askrene/test/run-flow.c @@ -0,0 +1,113 @@ +#include "config.h" +#include +#include +#include +#include +#include +#include + +#include "../algorithm.c" + +#define MAX_NODES 256 +#define MAX_ARCS 256 +#define DUAL_BIT 7 + +#define CHECK(arg) if(!(arg)){fprintf(stderr, "failed CHECK at line %d: %s\n", __LINE__, #arg); abort();} + +static void problem1(void){ + printf("Allocating a memory context\n"); + tal_t *ctx = tal(NULL, tal_t); + assert(ctx); + + printf("Allocating a graph\n"); + struct graph *graph = graph_new(ctx, MAX_NODES, MAX_ARCS, DUAL_BIT); + assert(graph); + + s64 *capacity = tal_arrz(ctx, s64, MAX_ARCS); + + graph_add_arc(graph, arc_obj(0), node_obj(1), node_obj(2)); + capacity[0] = 1; + graph_add_arc(graph, arc_obj(1), node_obj(1), node_obj(3)); + capacity[1] = 4; + graph_add_arc(graph, arc_obj(2), node_obj(2), node_obj(4)); + capacity[2] = 1; + graph_add_arc(graph, arc_obj(3), node_obj(2), node_obj(5)); + capacity[3] = 1; + graph_add_arc(graph, arc_obj(4), node_obj(3), node_obj(5)); + capacity[4] = 4; + graph_add_arc(graph, arc_obj(5), node_obj(4), node_obj(6)); + capacity[5] = 1; + graph_add_arc(graph, arc_obj(6), node_obj(6), node_obj(10)); + capacity[6] = 1; + graph_add_arc(graph, arc_obj(7), node_obj(5), node_obj(10)); + capacity[7] = 4; + + struct node src = {.idx = 1}; + struct node dst = {.idx = 10}; + + bool result = simple_feasibleflow(ctx, graph, src, dst, capacity, 5); + CHECK(result); + + CHECK(node_balance(graph, src, capacity) == -5); + CHECK(node_balance(graph, dst, capacity) == 5); + + for (u32 i = 2; i < 10; i++) + CHECK(node_balance(graph, node_obj(i), capacity) == 0); + + printf("Freeing memory\n"); + ctx = tal_free(ctx); +} + +static void problem2(void){ + /* Stress the graph constraints by setting max_num_nodes to exactly the + * number of node that participate and put all nodes in line to achieve + * the largest path length possible. */ + printf("Allocating a memory context\n"); + tal_t *ctx = tal(NULL, tal_t); + assert(ctx); + + printf("Allocating a graph\n"); + struct graph *graph = graph_new(ctx, 5, MAX_ARCS, DUAL_BIT); + assert(graph); + + s64 *capacity = tal_arrz(ctx, s64, MAX_ARCS); + + graph_add_arc(graph, arc_obj(0), node_obj(0), node_obj(1)); + capacity[0] = 1; + graph_add_arc(graph, arc_obj(1), node_obj(1), node_obj(2)); + capacity[1] = 4; + graph_add_arc(graph, arc_obj(2), node_obj(2), node_obj(3)); + capacity[2] = 1; + graph_add_arc(graph, arc_obj(3), node_obj(3), node_obj(4)); + capacity[3] = 1; + + struct node src = {.idx = 0}; + struct node dst = {.idx = 4}; + + bool result = simple_feasibleflow(ctx, graph, src, dst, capacity, 1); + CHECK(result); + + CHECK(node_balance(graph, src, capacity) == -1); + CHECK(node_balance(graph, dst, capacity) == 1); + + for (u32 i = 1; i < 4; i++) + CHECK(node_balance(graph, node_obj(i), capacity) == 0); + + printf("Freeing memory\n"); + ctx = tal_free(ctx); +} + +int main(int argc, char *argv[]) +{ + common_setup(argv[0]); + + printf("\n\nProblem 1\n\n"); + problem1(); + + printf("\n\nProblem 2\n\n"); + problem2(); + + common_shutdown(); + return 0; +} + From 6c339f76b4e943c8dca5fac36251bf3f8d640b7a Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Wed, 16 Oct 2024 15:49:30 +0100 Subject: [PATCH 06/23] askrene: add a simple MCF solver Changelog-EXPERIMENTAL: askrene: add a simple MCF solver Signed-off-by: Lagrang3 --- plugins/askrene/algorithm.c | 84 ++++++++++++++++++++++++++++++++++ plugins/askrene/algorithm.h | 38 +++++++++++++++ plugins/askrene/test/Makefile | 2 +- plugins/askrene/test/run-mcf.c | 68 +++++++++++++++++++++++++++ 4 files changed, 191 insertions(+), 1 deletion(-) create mode 100644 plugins/askrene/test/run-mcf.c diff --git a/plugins/askrene/algorithm.c b/plugins/askrene/algorithm.c index bea80c80a903..71a20390ce80 100644 --- a/plugins/askrene/algorithm.c +++ b/plugins/askrene/algorithm.c @@ -322,3 +322,87 @@ s64 node_balance(const struct graph *graph, } return balance; } + + +bool simple_mcf(const tal_t *ctx, const struct graph *graph, + const struct node source, const struct node destination, + s64 *capacity, s64 amount, const s64 *cost) +{ + tal_t *this_ctx = tal(ctx, tal_t); + const size_t max_num_arcs = graph_max_num_arcs(graph); + const size_t max_num_nodes = graph_max_num_nodes(graph); + s64 remaining_amount = amount; + + if (amount < 0) + goto finish; + + if (!graph || source.idx >= max_num_nodes || + destination.idx >= max_num_nodes || !capacity || !cost) + goto finish; + + if (tal_count(capacity) != max_num_arcs || + tal_count(cost) != max_num_arcs) + goto finish; + + struct arc *prev = tal_arr(this_ctx, struct arc, max_num_nodes); + s64 *distance = tal_arrz(this_ctx, s64, max_num_nodes); + s64 *potential = tal_arrz(this_ctx, s64, max_num_nodes); + + if (!prev || !distance || !potential) + goto finish; + + /* FIXME: implement this algorithm as a search for matching negative and + * positive balance nodes, so that we can use it to adapt a flow + * structure for changes in the cost function. */ + while (remaining_amount > 0) { + if (!dijkstra_path(this_ctx, graph, source, destination, + /* prune = */ true, capacity, 1, cost, + potential, prev, distance)) + goto finish; + + /* traverse the path and see how much flow we can send */ + s64 delta = get_augmenting_flow(graph, source, destination, + capacity, prev); + + /* commit that flow to the path */ + delta = MIN(remaining_amount, delta); + assert(delta > 0 && delta <= remaining_amount); + + augment_flow(graph, source, destination, prev, capacity, delta); + remaining_amount -= delta; + + /* update potentials */ + for (u32 n = 0; n < max_num_nodes; n++) { + /* see page 323 of Ahuja-Magnanti-Orlin. + * Whether we prune or not the Dijkstra search, the + * following potentials will keep reduced costs + * non-negative. */ + potential[n] -= + MIN(distance[destination.idx], distance[n]); + } + } +finish: + tal_free(this_ctx); + return remaining_amount == 0; +} + +s64 flow_cost(const struct graph *graph, const s64 *capacity, const s64 *cost) +{ + const size_t max_num_arcs = graph_max_num_arcs(graph); + s64 total_cost = 0; + + assert(graph && capacity && cost); + assert(tal_count(capacity) == max_num_arcs && + tal_count(cost) == max_num_arcs); + + for (u32 i = 0; i < max_num_arcs; i++) { + struct arc arc = {.idx = i}; + struct arc dual = arc_dual(graph, arc); + + if (arc_is_dual(graph, arc)) + continue; + + total_cost += capacity[dual.idx] * cost[arc.idx]; + } + return total_cost; +} diff --git a/plugins/askrene/algorithm.h b/plugins/askrene/algorithm.h index 5f13107cb947..3ba1882be117 100644 --- a/plugins/askrene/algorithm.h +++ b/plugins/askrene/algorithm.h @@ -115,4 +115,42 @@ bool simple_feasibleflow(const tal_t *ctx, const struct graph *graph, s64 node_balance(const struct graph *graph, const struct node node, const s64 *capacity); + +/* Finds the minimum cost flow that satisfy the capacity constraints: + * flow[i] <= capacity[i] + * and supply/demand constraints: + * supply[source] = demand[destination] = amount + * supply/demand[node] = 0 for every other node + * + * It uses successive shortest path algorithm. + * + * input: + * @ctx: tal context for internal allocation + * @graph: topological information of the graph + * @source: source node + * @destination: destination node + * @capacity: arcs capacity + * @amount: desired balance at the destination + * @cost: cost per unit of flow + * + * output: + * @capacity: residual capacity + * returns true if the balance constraint can be satisfied + * + * precondition: + * |capacity|=graph_max_num_arcs + * |cost|=graph_max_num_arcs + * amount>=0 + * */ +bool simple_mcf(const tal_t *ctx, const struct graph *graph, + const struct node source, const struct node destination, + s64 *capacity, s64 amount, const s64 *cost); + +/* Compute the cost of a flow in the network. + * + * @graph: network topology + * @capacity: residual capacity (encodes the flow) + * @cost: cost per unit of flow */ +s64 flow_cost(const struct graph *graph, const s64 *capacity, const s64 *cost); + #endif /* LIGHTNING_PLUGINS_ASKRENE_ALGORITHM_H */ diff --git a/plugins/askrene/test/Makefile b/plugins/askrene/test/Makefile index 6b414fc62d2d..45aa8feab332 100644 --- a/plugins/askrene/test/Makefile +++ b/plugins/askrene/test/Makefile @@ -10,7 +10,7 @@ $(PLUGIN_RENEPAY_TEST_OBJS): $(PLUGIN_ASKRENE_SRC) PLUGIN_ASKRENE_TEST_COMMON_OBJS := -plugins/askrene/test/run-bfs plugins/askrene/test/run-dijkstra plugins/askrene/test/run-flow: \ +plugins/askrene/test/run-bfs plugins/askrene/test/run-dijkstra plugins/askrene/test/run-flow plugins/askrene/test/run-mcf: \ plugins/askrene/priorityqueue.o \ plugins/askrene/graph.o diff --git a/plugins/askrene/test/run-mcf.c b/plugins/askrene/test/run-mcf.c new file mode 100644 index 000000000000..e06ae3752e74 --- /dev/null +++ b/plugins/askrene/test/run-mcf.c @@ -0,0 +1,68 @@ +#include "config.h" +#include +#include +#include +#include +#include +#include + +#include "../algorithm.c" + +#define CHECK(arg) if(!(arg)){fprintf(stderr, "failed CHECK at line %d: %s\n", __LINE__, #arg); abort();} + +#define MAX_NODES 256 +#define MAX_ARCS 256 +#define DUAL_BIT 7 + +int main(int argc, char *argv[]) +{ + common_setup(argv[0]); + printf("Allocating a memory context\n"); + tal_t *ctx = tal(NULL, tal_t); + assert(ctx); + + printf("Allocating a graph\n"); + struct graph *graph = graph_new(ctx, MAX_NODES, MAX_ARCS, DUAL_BIT); + assert(graph); + + s64 *capacity = tal_arrz(ctx, s64, MAX_ARCS); + s64 *cost = tal_arrz(ctx, s64, MAX_ARCS); + + graph_add_arc(graph, arc_obj(0), node_obj(0), node_obj(1)); + capacity[0] = 2, cost[0] = 0; + graph_add_arc(graph, arc_obj(1), node_obj(0), node_obj(2)); + capacity[1] = 2, cost[1] = 0; + graph_add_arc(graph, arc_obj(2), node_obj(1), node_obj(3)); + capacity[2] = 1, cost[2] = 1; + graph_add_arc(graph, arc_obj(3), node_obj(1), node_obj(4)); + capacity[3] = 1, cost[3] = 2; + graph_add_arc(graph, arc_obj(4), node_obj(2), node_obj(3)); + capacity[4] = 2, cost[4] = 1; + graph_add_arc(graph, arc_obj(5), node_obj(2), node_obj(4)); + capacity[5] = 1, cost[5] = 2; + graph_add_arc(graph, arc_obj(6), node_obj(3), node_obj(5)); + capacity[6] = 3, cost[6] = 0; + graph_add_arc(graph, arc_obj(7), node_obj(4), node_obj(5)); + capacity[7] = 3, cost[7] = 0; + + struct node src = {.idx = 0}; + struct node dst = {.idx = 5}; + + bool result = simple_mcf(ctx, graph, src, dst, capacity, 4, cost); + CHECK(result); + + CHECK(node_balance(graph, src, capacity) == -4); + CHECK(node_balance(graph, dst, capacity) == 4); + + for (u32 i = 1; i < 4; i++) + CHECK(node_balance(graph, node_obj(i), capacity) == 0); + + const s64 total_cost = flow_cost(graph, capacity, cost); + printf("best flow cost: %" PRIi64 "\n", total_cost); + CHECK(total_cost == 5); + + printf("Freeing memory\n"); + ctx = tal_free(ctx); + common_shutdown(); + return 0; +} From b36f35535f8159770f953bbd9ddf47798eb52ec8 Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Thu, 17 Oct 2024 11:28:57 +0100 Subject: [PATCH 07/23] askrene algorithm add helper for flow conservation Changelog-None: askrene algorithm add helper for flow conservation Signed-off-by: Lagrang3 --- plugins/askrene/algorithm.c | 41 +++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/plugins/askrene/algorithm.c b/plugins/askrene/algorithm.c index 71a20390ce80..1c0288194609 100644 --- a/plugins/askrene/algorithm.c +++ b/plugins/askrene/algorithm.c @@ -212,11 +212,35 @@ static s64 get_augmenting_flow(const struct graph *graph, return flow; } + +/* Helper. + * Sends an amount of flow through an arc, changing the flow balance of the + * nodes connected by the arc and the [residual] capacity of the arc and its + * dual. */ +static inline void sendflow(const struct graph *graph, const struct arc arc, + const s64 flow, s64 *arc_capacity, + s64 *node_balance) +{ + const struct arc dual = arc_dual(graph, arc); + + arc_capacity[arc.idx] -= flow; + arc_capacity[dual.idx] += flow; + + if (node_balance) { + const struct node src = arc_tail(graph, arc), + dst = arc_tail(graph, dual); + + node_balance[src.idx] -= flow; + node_balance[dst.idx] += flow; + } +} + /* Augment a `flow` amount along the path defined by `prev`.*/ static void augment_flow(const struct graph *graph, const struct node source, const struct node target, const struct arc *prev, + s64 *excess, s64 *capacity, s64 flow) { @@ -232,15 +256,8 @@ static void augment_flow(const struct graph *graph, while (cur.idx != source.idx) { assert(cur.idx < max_num_nodes); const struct arc arc = prev[cur.idx]; - const struct arc dual = arc_dual(graph, arc); - - assert(arc.idx < max_num_arcs); - assert(dual.idx < max_num_arcs); - - capacity[arc.idx] -= flow; - capacity[dual.idx] += flow; - assert(capacity[arc.idx] >= 0); + sendflow(graph, arc, flow, capacity, excess); /* we are traversing in the opposite direction to the flow, * hence the next node is at the tail of the arc. */ @@ -249,7 +266,7 @@ static void augment_flow(const struct graph *graph, /* We may never have a path exceeds the number of nodes, it this * happens it means we have an infinite loop. */ path_length++; - if(path_length >= max_num_nodes) + if (path_length >= max_num_nodes) break; } assert(path_length < max_num_nodes); @@ -297,7 +314,8 @@ bool simple_feasibleflow(const tal_t *ctx, delta = MIN(amount, delta); assert(delta > 0 && delta <= amount); - augment_flow(graph, source, destination, prev, capacity, delta); + augment_flow(graph, source, destination, prev, NULL, capacity, + delta); amount -= delta; } finish: @@ -368,7 +386,8 @@ bool simple_mcf(const tal_t *ctx, const struct graph *graph, delta = MIN(remaining_amount, delta); assert(delta > 0 && delta <= remaining_amount); - augment_flow(graph, source, destination, prev, capacity, delta); + augment_flow(graph, source, destination, prev, NULL, capacity, + delta); remaining_amount -= delta; /* update potentials */ From 3c87eddb83c729911d7b052fcbb62d2e9fc76d7b Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Thu, 17 Oct 2024 11:40:45 +0100 Subject: [PATCH 08/23] askrene: add a MCF refinement Add a new function to compute a MCF using a more general description of the problem. I call it mcf_refinement because it can start with a feasible flow (though this is not necessary) and adapt it to achieve optimality. Changelog-None: askrene: add a MCF refinement Signed-off-by: Lagrang3 --- plugins/askrene/algorithm.c | 343 +++++++++++++++++++++++++++++++----- 1 file changed, 302 insertions(+), 41 deletions(-) diff --git a/plugins/askrene/algorithm.c b/plugins/askrene/algorithm.c index 1c0288194609..6cda6f005bfc 100644 --- a/plugins/askrene/algorithm.c +++ b/plugins/askrene/algorithm.c @@ -341,68 +341,329 @@ s64 node_balance(const struct graph *graph, return balance; } +/* Helper. + * Compute the reduced cost of an arc. */ +static inline s64 reduced_cost(const struct graph *graph, const struct arc arc, + const s64 *cost, const s64 *potential) +{ + struct node src = arc_tail(graph, arc); + struct node dst = arc_head(graph, arc); + return cost[arc.idx] - potential[src.idx] + potential[dst.idx]; +} + +/* Finds an optimal path from the source to the nearest sink node, by definition + * a node i is a sink if node_balance[i]<0. It uses a reduced cost: + * reduced_cost[i,j] = cost[i,j] - potential[i] + potential[j] + * + * */ +static struct node dijkstra_nearest_sink(const tal_t *ctx, + const struct graph *graph, + const struct node source, + const s64 *node_balance, + const s64 *capacity, + const s64 cap_threshold, + const s64 *cost, + const s64 *potential, + struct arc *prev, + s64 *distance) +{ + struct node target = {.idx = INVALID_INDEX}; + tal_t *this_ctx = tal(ctx, tal_t); + + if (!this_ctx) + /* bad allocation */ + goto finish; + + /* check preconditions */ + assert(graph); + assert(node_balance); + assert(capacity); + assert(cost); + assert(potential); + assert(prev); + assert(distance); + + const size_t max_num_arcs = graph_max_num_arcs(graph); + const size_t max_num_nodes = graph_max_num_nodes(graph); + + assert(source.idx < max_num_nodes); + assert(tal_count(node_balance) == max_num_nodes); + assert(tal_count(capacity) == max_num_arcs); + assert(tal_count(cost) == max_num_arcs); + assert(tal_count(potential) == max_num_nodes); + assert(tal_count(prev) == max_num_nodes); + assert(tal_count(distance) == max_num_nodes); + + for (size_t i = 0; i < max_num_arcs; i++) { + /* is this arc saturated? */ + if (capacity[i] < cap_threshold) + continue; + + struct arc arc = {.idx = i}; + struct node tail = arc_tail(graph, arc); + struct node head = arc_head(graph, arc); + s64 red_cost = + cost[i] - potential[tail.idx] + potential[head.idx]; + + /* reducted cost cannot be negative for non saturated arcs, + * otherwise Dijkstra does not work. */ + if (red_cost < 0) + goto finish; + } + + for (size_t i = 0; i < max_num_nodes; ++i) + prev[i].idx = INVALID_INDEX; + +/* Only in debug mode we keep track of visited nodes. */ +#ifndef NDEBUG + bitmap *visited = + tal_arrz(this_ctx, bitmap, BITMAP_NWORDS(max_num_nodes)); + assert(visited); +#endif + + struct priorityqueue *q; + q = priorityqueue_new(this_ctx, max_num_nodes); + const s64 *const dijkstra_distance = priorityqueue_value(q); + + priorityqueue_init(q); + priorityqueue_update(q, source.idx, 0); + + while (!priorityqueue_empty(q)) { + const u32 idx = priorityqueue_top(q); + const struct node cur = {.idx = idx}; + priorityqueue_pop(q); + +/* Only in debug mode we keep track of visited nodes. */ +#ifndef NDEBUG + assert(!bitmap_test_bit(visited, cur.idx)); + bitmap_set_bit(visited, cur.idx); +#endif + + if (node_balance[cur.idx] < 0) { + target = cur; + break; + } + + for (struct arc arc = node_adjacency_begin(graph, cur); + !node_adjacency_end(arc); + arc = node_adjacency_next(graph, arc)) { + /* check if this arc is traversable */ + if (capacity[arc.idx] < cap_threshold) + continue; + + const struct node next = arc_head(graph, arc); + + const s64 cij = cost[arc.idx] - potential[cur.idx] + + potential[next.idx]; + + /* Dijkstra only works with non-negative weights */ + assert(cij >= 0); + + if (dijkstra_distance[next.idx] <= + dijkstra_distance[cur.idx] + cij) + continue; + + priorityqueue_update(q, next.idx, + dijkstra_distance[cur.idx] + cij); + prev[next.idx] = arc; + } + } + for (size_t i = 0; i < max_num_nodes; i++) + distance[i] = dijkstra_distance[i]; + +finish: + tal_free(this_ctx); + return target; +} + +/* Problem: find a potential and capacity redistribution such that: + * excess[all nodes] = 0 + * capacity[all arcs] >= 0 + * cost/potential [i,j] < 0 implies capacity[i,j] = 0 + * + * Q. Is this a feasible solution? + * + * A. If we use flow conserving function sendflow, then + * if for all nodes excess[i] = 0 and capacity[i,j] >= 0 for all arcs + * then we have reached a feasible flow. + * + * Q. Is this flow optimal? + * + * A. According to Theorem 9.4 (Ahuja page 309) we have reached an optimal + * solution if we are able to find a potential and flow that satisfy the + * slackness optimality conditions: + * + * if cost_reduced[i,j] > 0 then x[i,j] = 0 + * if 0 < x[i,j] < u[i,j] then cost_reduced[i,j] = 0 + * if cost_reduced[i,j] < 0 then x[i,j] = u[i,j] + * + * In our representation the slackness optimality conditions are equivalent + * to the following condition in the residual network: + * + * cost_reduced[i,j] < 0 then capacity[i,j] = 0 + * + * Therefore yes, the solution is optimal. + * + * Q. Why is this useful? + * + * A. It can be used to compute a MCF from scratch or build an optimal + * solution starting from a non-optimal one, eg. if we first test the + * solution feasibility we already have a solution canditate, we use that + * flow as input to this function, in another example we might have an + * algorithm that changes the cost function at every iteration and we need + * to find the MCF every time. + * */ +static bool mcf_refinement(const tal_t *ctx, + const struct graph *graph, + s64 *excess, + s64 *capacity, + const s64 *cost, + s64 *potential) +{ + bool solved = false; + tal_t *this_ctx = tal(ctx, tal_t); + + if (!this_ctx) + /* bad allocation */ + goto finish; + + assert(graph); + assert(excess); + assert(capacity); + assert(cost); + assert(potential); + + const size_t max_num_arcs = graph_max_num_arcs(graph); + const size_t max_num_nodes = graph_max_num_nodes(graph); + + assert(tal_count(excess) == max_num_nodes); + assert(tal_count(capacity) == max_num_arcs); + assert(tal_count(cost) == max_num_arcs); + assert(tal_count(potential) == max_num_nodes); + + s64 total_excess = 0; + for (u32 i = 0; i < max_num_nodes; i++) + total_excess += excess[i]; + + if (total_excess) + /* there is no way to satisfy the constraints if supply does not + * match demand */ + goto finish; + + /* Enforce the complementary slackness condition, rolls back + * constraints. */ + for (u32 arc_id = 0; arc_id < max_num_arcs; arc_id++) { + struct arc arc = {.idx = arc_id}; + const s64 r = capacity[arc.idx]; + + if (reduced_cost(graph, arc, cost, potential) < 0 && r > 0) { + /* This arc's reduced cost is negative and non + * saturated. */ + sendflow(graph, arc, r, capacity, excess); + } + } + + struct arc *prev = tal_arr(this_ctx, struct arc, max_num_nodes); + s64 *distance = tal_arrz(this_ctx, s64, max_num_nodes); + if (!prev || !distance) + goto finish; + + /* Now build back constraints again keeping the complementary slackness + * condition. */ + for (u32 node_id = 0; node_id < max_num_nodes; node_id++) { + struct node src = {.idx = node_id}; + + /* is this node a source */ + while (excess[src.idx] > 0) { + + /* where is the nearest sink */ + struct node dst = dijkstra_nearest_sink( + this_ctx, graph, src, excess, capacity, 1, cost, + potential, prev, distance); + + if (dst.idx >= max_num_nodes) + /* we failed to find a reacheable sink */ + goto finish; + + /* traverse the path and see how much flow we can send + */ + s64 delta = get_augmenting_flow(graph, src, dst, + capacity, prev); + + delta = MIN(excess[src.idx], delta); + delta = MIN(-excess[dst.idx], delta); + assert(delta > 0); + + /* commit that flow to the path */ + augment_flow(graph, src, dst, prev, excess, capacity, + delta); + + /* update potentials */ + for (u32 n = 0; n < max_num_nodes; n++) { + /* see page 323 of Ahuja-Magnanti-Orlin. + * Whether we prune or not the Dijkstra search, + * the following potentials will keep reduced + * costs non-negative. */ + potential[n] -= + MIN(distance[dst.idx], distance[n]); + } + } + } + +#ifndef NDEBUG + /* verify that we have satisfied all constraints */ + for (u32 i = 0; i < max_num_nodes; i++) { + assert(excess[i] == 0); + } +#endif + +finish: + tal_free(this_ctx); + return solved; +} bool simple_mcf(const tal_t *ctx, const struct graph *graph, const struct node source, const struct node destination, s64 *capacity, s64 amount, const s64 *cost) { tal_t *this_ctx = tal(ctx, tal_t); + if (!this_ctx) + /* bad allocation */ + goto fail; + + if (!graph) + goto fail; + const size_t max_num_arcs = graph_max_num_arcs(graph); const size_t max_num_nodes = graph_max_num_nodes(graph); - s64 remaining_amount = amount; - - if (amount < 0) - goto finish; - if (!graph || source.idx >= max_num_nodes || + if (amount < 0 || source.idx >= max_num_nodes || destination.idx >= max_num_nodes || !capacity || !cost) - goto finish; + goto fail; if (tal_count(capacity) != max_num_arcs || tal_count(cost) != max_num_arcs) - goto finish; + goto fail; - struct arc *prev = tal_arr(this_ctx, struct arc, max_num_nodes); - s64 *distance = tal_arrz(this_ctx, s64, max_num_nodes); s64 *potential = tal_arrz(this_ctx, s64, max_num_nodes); + s64 *excess = tal_arrz(this_ctx, s64, max_num_nodes); - if (!prev || !distance || !potential) - goto finish; + if (!potential || !excess) + /* bad allocation */ + goto fail; - /* FIXME: implement this algorithm as a search for matching negative and - * positive balance nodes, so that we can use it to adapt a flow - * structure for changes in the cost function. */ - while (remaining_amount > 0) { - if (!dijkstra_path(this_ctx, graph, source, destination, - /* prune = */ true, capacity, 1, cost, - potential, prev, distance)) - goto finish; + excess[source.idx] = amount; + excess[destination.idx] = -amount; - /* traverse the path and see how much flow we can send */ - s64 delta = get_augmenting_flow(graph, source, destination, - capacity, prev); + if (!mcf_refinement(this_ctx, graph, excess, capacity, cost, potential)) + goto fail; - /* commit that flow to the path */ - delta = MIN(remaining_amount, delta); - assert(delta > 0 && delta <= remaining_amount); + tal_free(this_ctx); + return true; - augment_flow(graph, source, destination, prev, NULL, capacity, - delta); - remaining_amount -= delta; - - /* update potentials */ - for (u32 n = 0; n < max_num_nodes; n++) { - /* see page 323 of Ahuja-Magnanti-Orlin. - * Whether we prune or not the Dijkstra search, the - * following potentials will keep reduced costs - * non-negative. */ - potential[n] -= - MIN(distance[destination.idx], distance[n]); - } - } -finish: +fail: tal_free(this_ctx); - return remaining_amount == 0; + return false; } s64 flow_cost(const struct graph *graph, const s64 *capacity, const s64 *cost) From 52a5f785dfc95a8950fc101fd11831d0677a05fe Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Fri, 18 Oct 2024 11:44:07 +0100 Subject: [PATCH 09/23] askrene: add bigger test for MCF Using zlib to read big test case file. Changelog-None: askrene: add bigger test for MCF Signed-off-by: Lagrang3 --- external/Makefile | 4 + plugins/askrene/test/Makefile | 2 +- plugins/askrene/test/data/linear_mcf.gz | Bin 0 -> 91128 bytes plugins/askrene/test/run-mcf-large.c | 136 ++++++++++++++++++++++++ 4 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 plugins/askrene/test/data/linear_mcf.gz create mode 100644 plugins/askrene/test/run-mcf-large.c diff --git a/external/Makefile b/external/Makefile index e199108bf0c1..a289032a5f68 100644 --- a/external/Makefile +++ b/external/Makefile @@ -53,6 +53,10 @@ else LDLIBS += -lsodium endif +ifeq ($(HAVE_ZLIB),1) +LDLIBS += -lz +endif + EXTERNAL_LDLIBS := -L${TARGET_DIR} $(patsubst lib%.a,-l%,$(notdir $(EXTERNAL_LIBS))) submodcheck: $(FORCE) diff --git a/plugins/askrene/test/Makefile b/plugins/askrene/test/Makefile index 45aa8feab332..88ee0b88a2fd 100644 --- a/plugins/askrene/test/Makefile +++ b/plugins/askrene/test/Makefile @@ -10,7 +10,7 @@ $(PLUGIN_RENEPAY_TEST_OBJS): $(PLUGIN_ASKRENE_SRC) PLUGIN_ASKRENE_TEST_COMMON_OBJS := -plugins/askrene/test/run-bfs plugins/askrene/test/run-dijkstra plugins/askrene/test/run-flow plugins/askrene/test/run-mcf: \ +plugins/askrene/test/run-bfs plugins/askrene/test/run-dijkstra plugins/askrene/test/run-flow plugins/askrene/test/run-mcf plugins/askrene/test/run-mcf-large: \ plugins/askrene/priorityqueue.o \ plugins/askrene/graph.o diff --git a/plugins/askrene/test/data/linear_mcf.gz b/plugins/askrene/test/data/linear_mcf.gz new file mode 100644 index 0000000000000000000000000000000000000000..b101fd5572176ccaab9ecacb24bf06f9a8ab508a GIT binary patch literal 91128 zcmV(&K;ge1iwFoz1v6&=18iw-Wnpq(ZDVEtOr2?#Zm9}H|K}*~5RQo5{3ljv?7*z` zR=wofqQ}n$0*HU@=lj?G&42Uf_y2$5U-;kW_us$N_nSEXjeI%n_wUV#fBWas{onYx z|7ySg{;L`P&cCj5`TO_gj^FfOdb&dU&7g~^g7I(tcBYclP~ZKxbgZB8s{9sd|N8Cj z68R6F`=wO3{acsQ@3+eQt z%gqv7=eH(ZO|`VdULE^Y~lh)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$tE&7T0@;dPd860^$_1A(1_ao%~#Bpuar{5!F;KCb(DoChVD0rVuN*d~cMoW}t`mA0{YoW$@(Ggh9TE`vs~^L6d}zDCjB9D)rg%MO2%o3*N}s5A$=KUrQ- zCvj9ze|x=W(EvD}Q=yp7DeWVy`FbS}`+NHtTybZAAYJKKYTkVgpTJZN>thb~RqECm zikP8p1}*=2(HG9)JEx`{HRl*#rnC*Z>Kq)UR!E5QglV;;BHy$B`&J-#4lO@cJD5CzxAj!?YW)q#)$y zv3Ig+q_@O_8BBFIcKP#=f# +#include +#include +#include +#include +#include + +#include "../algorithm.c" + +#ifdef HAVE_ZLIB +#include + +gzFile infile; +#define BUFFER_SIZE 10000 +char buffer[BUFFER_SIZE]; + +static int myscanf(const char *fmt, ...) +{ + gzgets(infile, buffer, BUFFER_SIZE); + va_list args; + va_start(args, fmt); + int ret = vsscanf(buffer, fmt, args); + va_end(args); + return ret; +} + +#endif + +#define CHECK(arg) if(!(arg)){fprintf(stderr, "failed CHECK at line %d: %s\n", __LINE__, #arg); abort();} + +/* Read multiple testcases from a file. + * Each test case consist of: + * - one line with N and M, the number of nodes and arcs + * - for each arc a line with numbers head, tail, cap and cost, defining the + * arc's endpoints and values, + * - one line with numbers: amount and best_cost, indicating that we wish to + * send amount from node 0 to node 1 with minimum cost, the correct answer + * should contain a flow cost equal to best_cost. + * + * A feasible solution is guaranteed. + * The last test case has 0 nodes and should be ignored. */ + +static int next_bit(s64 x) +{ + int b; + for (b = 0; (1LL << b) <= x; b++) + ; + return b; +} + +static bool solve_case(const tal_t *ctx) +{ + static int c = 0; + c++; + tal_t *this_ctx = tal(ctx, tal_t); + + int N_nodes, N_arcs; + scanf("%d %d\n", &N_nodes, &N_arcs); + printf("Testcase %d\n", c); + printf("nodes %d arcs %d\n", N_nodes, N_arcs); + if (N_nodes == 0 && N_arcs == 0) + goto fail; + + const int MAX_NODES = N_nodes; + const int DUAL_BIT = next_bit(N_arcs-1); + const int MAX_ARCS = 1LL << (DUAL_BIT+1); + printf("max nodes %d max arcs %d bit %d\n", MAX_NODES, MAX_ARCS, DUAL_BIT); + + struct graph *graph = graph_new(ctx, MAX_NODES, MAX_ARCS, DUAL_BIT); + assert(graph); + + s64 *capacity = tal_arrz(ctx, s64, MAX_ARCS); + s64 *cost = tal_arrz(ctx, s64, MAX_ARCS); + + for (u32 i = 0; i < N_arcs; i++) { + u32 from, to; + scanf("%" PRIu32 " %" PRIu32 " %" PRIi64 " %" PRIi64, &from, + &to, &capacity[i], &cost[i]); + + struct arc arc = {.idx = i}; + graph_add_arc(graph, arc, node_obj(from), node_obj(to)); + + struct arc dual = arc_dual(graph, arc); + cost[dual.idx] = -cost[i]; + } + printf("Reading arcs finished\n"); + struct node src = {.idx = 0}; + struct node dst = {.idx = 1}; + + s64 amount, best_cost; + scanf("%" PRIi64 " %" PRIi64, &amount, &best_cost); + + bool result = simple_mcf(ctx, graph, src, dst, capacity, amount, cost); + assert(result); + + assert(node_balance(graph, src, capacity) == -amount); + assert(node_balance(graph, dst, capacity) == amount); + + for (u32 i = 2; i < N_nodes; i++) + assert(node_balance(graph, node_obj(i), capacity) == 0); + + const s64 total_cost = flow_cost(graph, capacity, cost); + assert(total_cost == best_cost); + + tal_free(this_ctx); + return true; + +fail: + tal_free(this_ctx); + return false; +} + +int main(int argc, char *argv[]) +{ +#ifdef HAVE_ZLIB + common_setup(argv[0]); + infile = gzopen("plugins/askrene/test/data/linear_mcf.gz", "r"); + CHECK(infile); + const tal_t *ctx = tal(NULL, tal_t); + CHECK(ctx); + + /* One test case after another. The last test case has N number of nodes + * and arcs equal to 0 and must be ignored. */ + while (solve_case(ctx)) + ; + + ctx = tal_free(ctx); + gzclose(infile); + common_shutdown(); + return 0; +#else + return 0; +#endif +} + From 8b730511926416363f48b46588d6760a2ef5c1ac Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Fri, 18 Oct 2024 11:45:40 +0100 Subject: [PATCH 10/23] askrene: fix bug, not all arcs exists We use an arc "array" in the graph structure, but not all arc indexes correspond to real topological arcs. We must be careful when iterating through all arcs, and check if they are enabled before making operations on them. Changelog-None: askrene: fix bug, not all arcs exists Signed-off-by: Lagrang3 --- plugins/askrene/algorithm.c | 15 ++++++++++++++- plugins/askrene/graph.h | 6 ++++++ plugins/askrene/test/run-mcf-large.c | 18 +++++++++--------- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/plugins/askrene/algorithm.c b/plugins/askrene/algorithm.c index 6cda6f005bfc..da7f24464d8e 100644 --- a/plugins/askrene/algorithm.c +++ b/plugins/askrene/algorithm.c @@ -554,8 +554,9 @@ static bool mcf_refinement(const tal_t *ctx, * constraints. */ for (u32 arc_id = 0; arc_id < max_num_arcs; arc_id++) { struct arc arc = {.idx = arc_id}; + if(!arc_enabled(graph, arc)) + continue; const s64 r = capacity[arc.idx]; - if (reduced_cost(graph, arc, cost, potential) < 0 && r > 0) { /* This arc's reduced cost is negative and non * saturated. */ @@ -615,7 +616,19 @@ static bool mcf_refinement(const tal_t *ctx, for (u32 i = 0; i < max_num_nodes; i++) { assert(excess[i] == 0); } + for (u32 i = 0; i < max_num_arcs; i++) { + struct arc arc = {.idx = i}; + if(!arc_enabled(graph, arc)) + continue; + const s64 cap = capacity[arc.idx]; + const s64 rc = reduced_cost(graph, arc, cost, potential); + + assert(cap >= 0); + /* asserts logic implication: (rc<0 -> cap==0)*/ + assert(!(rc < 0) || cap == 0); + } #endif + solved = true; finish: tal_free(this_ctx); diff --git a/plugins/askrene/graph.h b/plugins/askrene/graph.h index c21b1f7ac810..3407826d8f02 100644 --- a/plugins/askrene/graph.h +++ b/plugins/askrene/graph.h @@ -97,6 +97,12 @@ static inline struct node arc_head(const struct graph *graph, return graph->arc_tail[dual.idx]; } +/* We use an arc array but not all arcs in that array do exist in the graph. */ +static inline bool arc_enabled(const struct graph *graph, const struct arc arc) +{ + return graph->arc_tail[arc.idx].idx < graph->max_num_nodes; +} + /* Used to loop over the arcs that exit a node. * * for example: diff --git a/plugins/askrene/test/run-mcf-large.c b/plugins/askrene/test/run-mcf-large.c index 40acc149d2f9..454874fca2fa 100644 --- a/plugins/askrene/test/run-mcf-large.c +++ b/plugins/askrene/test/run-mcf-large.c @@ -56,7 +56,7 @@ static bool solve_case(const tal_t *ctx) tal_t *this_ctx = tal(ctx, tal_t); int N_nodes, N_arcs; - scanf("%d %d\n", &N_nodes, &N_arcs); + myscanf("%d %d\n", &N_nodes, &N_arcs); printf("Testcase %d\n", c); printf("nodes %d arcs %d\n", N_nodes, N_arcs); if (N_nodes == 0 && N_arcs == 0) @@ -68,14 +68,14 @@ static bool solve_case(const tal_t *ctx) printf("max nodes %d max arcs %d bit %d\n", MAX_NODES, MAX_ARCS, DUAL_BIT); struct graph *graph = graph_new(ctx, MAX_NODES, MAX_ARCS, DUAL_BIT); - assert(graph); + CHECK(graph); s64 *capacity = tal_arrz(ctx, s64, MAX_ARCS); s64 *cost = tal_arrz(ctx, s64, MAX_ARCS); for (u32 i = 0; i < N_arcs; i++) { u32 from, to; - scanf("%" PRIu32 " %" PRIu32 " %" PRIi64 " %" PRIi64, &from, + myscanf("%" PRIu32 " %" PRIu32 " %" PRIi64 " %" PRIi64, &from, &to, &capacity[i], &cost[i]); struct arc arc = {.idx = i}; @@ -89,19 +89,19 @@ static bool solve_case(const tal_t *ctx) struct node dst = {.idx = 1}; s64 amount, best_cost; - scanf("%" PRIi64 " %" PRIi64, &amount, &best_cost); + myscanf("%" PRIi64 " %" PRIi64, &amount, &best_cost); bool result = simple_mcf(ctx, graph, src, dst, capacity, amount, cost); - assert(result); + CHECK(result); - assert(node_balance(graph, src, capacity) == -amount); - assert(node_balance(graph, dst, capacity) == amount); + CHECK(node_balance(graph, src, capacity) == -amount); + CHECK(node_balance(graph, dst, capacity) == amount); for (u32 i = 2; i < N_nodes; i++) - assert(node_balance(graph, node_obj(i), capacity) == 0); + CHECK(node_balance(graph, node_obj(i), capacity) == 0); const s64 total_cost = flow_cost(graph, capacity, cost); - assert(total_cost == best_cost); + CHECK(total_cost == best_cost); tal_free(this_ctx); return true; From 6777925c3188fff2b15cd9621e7994811458c25e Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Mon, 21 Oct 2024 15:15:38 +0100 Subject: [PATCH 11/23] askrene: add mcf_refinement to the public API Changelog-none: askrene: add mcf_refinement to the public API Signed-off-by: Lagrang3 --- plugins/askrene/algorithm.c | 12 ++++++------ plugins/askrene/algorithm.h | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/plugins/askrene/algorithm.c b/plugins/askrene/algorithm.c index da7f24464d8e..13345e74a91b 100644 --- a/plugins/askrene/algorithm.c +++ b/plugins/askrene/algorithm.c @@ -513,12 +513,12 @@ static struct node dijkstra_nearest_sink(const tal_t *ctx, * algorithm that changes the cost function at every iteration and we need * to find the MCF every time. * */ -static bool mcf_refinement(const tal_t *ctx, - const struct graph *graph, - s64 *excess, - s64 *capacity, - const s64 *cost, - s64 *potential) +bool mcf_refinement(const tal_t *ctx, + const struct graph *graph, + s64 *excess, + s64 *capacity, + const s64 *cost, + s64 *potential) { bool solved = false; tal_t *this_ctx = tal(ctx, tal_t); diff --git a/plugins/askrene/algorithm.h b/plugins/askrene/algorithm.h index 3ba1882be117..40010eb5cfd9 100644 --- a/plugins/askrene/algorithm.h +++ b/plugins/askrene/algorithm.h @@ -153,4 +153,27 @@ bool simple_mcf(const tal_t *ctx, const struct graph *graph, * @cost: cost per unit of flow */ s64 flow_cost(const struct graph *graph, const s64 *capacity, const s64 *cost); +/* Take an existent flow and find an optimal redistribution: + * + * inputs: + * @ctx: tal context for internal allocation, + * @graph: topological information of the graph, + * @excess: supply/demand of nodes, + * @capacity: residual capacity in the arcs, + * @cost: cost per unit of flow for every arc, + * @potential: node potential, + * + * outputs: + * @excess: all values become zero if there exist a feasible solution, + * @capacity: encodes the resulting flow, + * @potential: the potential that proves the solution using the complementary + * slackness optimality condition. + * */ +bool mcf_refinement(const tal_t *ctx, + const struct graph *graph, + s64 *excess, + s64 *capacity, + const s64 *cost, + s64 *potential); + #endif /* LIGHTNING_PLUGINS_ASKRENE_ALGORITHM_H */ From 93ab27e932880ad231a7fbaecd5cf19d0239335f Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Mon, 21 Oct 2024 15:20:08 +0100 Subject: [PATCH 12/23] askrene: use the new MCF solver Changelog-none: askrene: use the new MCF solver Signed-off-by: Lagrang3 --- plugins/askrene/mcf.c | 639 ++++++++---------------------------------- 1 file changed, 124 insertions(+), 515 deletions(-) diff --git a/plugins/askrene/mcf.c b/plugins/askrene/mcf.c index d8d2370babcb..997dd50b6e83 100644 --- a/plugins/askrene/mcf.c +++ b/plugins/askrene/mcf.c @@ -8,9 +8,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -163,7 +165,6 @@ static const double CHANNEL_PIVOTS[]={0,0.5,0.8,0.95}; static const s64 INFINITE = INT64_MAX; -static const u32 INVALID_INDEX = 0xffffffff; static const s64 MU_MAX = 100; /* Let's try this encoding of arcs: @@ -234,10 +235,6 @@ static const s64 MU_MAX = 100; * [ 0 1 2 3 4 5 6 ... 31 ] * dual part chandir chanidx */ -struct arc { - u32 idx; -}; - #define ARC_DUAL_BITOFF (0) #define ARC_PART_BITOFF (1) #define ARC_CHANDIR_BITOFF (1 + PARTS_BITS) @@ -304,19 +301,12 @@ struct pay_parameters { * capacity; these quantities remain constant during MCF execution. */ struct linear_network { - u32 *arc_tail_node; - // notice that a tail node is not needed, - // because the tail of arc is the head of dual(arc) - - struct arc *node_adjacency_next_arc; - struct arc *node_adjacency_first_arc; + struct graph *graph; // probability and fee cost associated to an arc double *arc_prob_cost; s64 *arc_fee_cost; s64 *capacity; - - size_t max_num_arcs,max_num_nodes; }; /* This is the structure that keeps track of the network properties while we @@ -330,78 +320,22 @@ struct residual_network { /* potential function on nodes */ s64 *potential; -}; -/* Helper function. - * Given an arc idx, return the dual's idx in the residual network. */ -static struct arc arc_dual(struct arc arc) -{ - arc.idx ^= (1U << ARC_DUAL_BITOFF); - return arc; -} -/* Helper function. */ -static bool arc_is_dual(struct arc arc) -{ - bool dual; - arc_to_parts(arc, NULL, NULL, NULL, &dual); - return dual; -} + /* auxiliary data, the excess of flow on nodes */ + s64 *excess; +}; /* Helper function. * Given an arc of the network (not residual) give me the flow. */ static s64 get_arc_flow( const struct residual_network *network, + const struct graph *graph, const struct arc arc) { - assert(!arc_is_dual(arc)); - assert(arc_dual(arc).idx < tal_count(network->cap)); - return network->cap[ arc_dual(arc).idx ]; -} - -/* Helper function. - * Given an arc idx, return the node from which this arc emanates in the residual network. */ -static u32 arc_tail(const struct linear_network *linear_network, - const struct arc arc) -{ - assert(arc.idx < linear_network->max_num_arcs); - return linear_network->arc_tail_node[ arc.idx ]; -} -/* Helper function. - * Given an arc idx, return the node that this arc is pointing to in the residual network. */ -static u32 arc_head(const struct linear_network *linear_network, - const struct arc arc) -{ - const struct arc dual = arc_dual(arc); - assert(dual.idx < linear_network->max_num_arcs); - return linear_network->arc_tail_node[dual.idx]; -} - -/* Helper function. - * Given node idx `node`, return the idx of the first arc whose tail is `node`. - * */ -static struct arc node_adjacency_begin( - const struct linear_network * linear_network, - const u32 node) -{ - assert(node < linear_network->max_num_nodes); - return linear_network->node_adjacency_first_arc[node]; -} - -/* Helper function. - * Is this the end of the adjacency list. */ -static bool node_adjacency_end(const struct arc arc) -{ - return arc.idx == INVALID_INDEX; -} - -/* Helper function. - * Given node idx `node` and `arc`, returns the idx of the next arc whose tail is `node`. */ -static struct arc node_adjacency_next( - const struct linear_network *linear_network, - const struct arc arc) -{ - assert(arc.idx < linear_network->max_num_arcs); - return linear_network->node_adjacency_next_arc[arc.idx]; + assert(!arc_is_dual(graph, arc)); + struct arc dual = arc_dual(graph, arc); + assert(dual.idx < tal_count(network->cap)); + return network->cap[dual.idx]; } /* Set *capacity to value, up to *cap_on_capacity. Reduce cap_on_capacity */ @@ -456,6 +390,8 @@ alloc_residual_network(const tal_t *ctx, const size_t max_num_nodes, residual_network->cost = tal_arrz(residual_network, s64, max_num_arcs); residual_network->potential = tal_arrz(residual_network, s64, max_num_nodes); + residual_network->excess = + tal_arrz(residual_network, s64, max_num_nodes); return residual_network; } @@ -464,23 +400,25 @@ static void init_residual_network( const struct linear_network * linear_network, struct residual_network* residual_network) { - const size_t max_num_arcs = linear_network->max_num_arcs; - const size_t max_num_nodes = linear_network->max_num_nodes; + const struct graph *graph = linear_network->graph; + const size_t max_num_arcs = graph_max_num_arcs(graph); + const size_t max_num_nodes = graph_max_num_nodes(graph); - for(struct arc arc = {0};arc.idx < max_num_arcs; ++arc.idx) - { - if(arc_is_dual(arc)) + for (struct arc arc = {.idx = 0}; arc.idx < max_num_arcs; ++arc.idx) { + if (arc_is_dual(graph, arc) || !arc_enabled(graph, arc)) continue; - struct arc dual = arc_dual(arc); - residual_network->cap[arc.idx]=linear_network->capacity[arc.idx]; - residual_network->cap[dual.idx]=0; + struct arc dual = arc_dual(graph, arc); + residual_network->cap[arc.idx] = + linear_network->capacity[arc.idx]; + residual_network->cap[dual.idx] = 0; - residual_network->cost[arc.idx]=residual_network->cost[dual.idx]=0; + residual_network->cost[arc.idx] = + residual_network->cost[dual.idx] = 0; } - for(u32 i=0;ipotential[i]=0; + for (u32 i = 0; i < max_num_nodes; ++i) { + residual_network->potential[i] = 0; + residual_network->excess[i] = 0; } } @@ -505,14 +443,16 @@ static int cmp_double(const double *a, const double *b, void *unused) static double get_median_ratio(const tal_t *working_ctx, const struct linear_network* linear_network) { - u64 *u64_arr = tal_arr(working_ctx, u64, linear_network->max_num_arcs/2); - double *double_arr = tal_arr(working_ctx, double, linear_network->max_num_arcs/2); + const struct graph *graph = linear_network->graph; + const size_t max_num_arcs = graph_max_num_arcs(graph); + u64 *u64_arr = tal_arr(working_ctx, u64, max_num_arcs); + double *double_arr = tal_arr(working_ctx, double, max_num_arcs); size_t n = 0; - for (struct arc arc = {0};arc.idx < linear_network->max_num_arcs; ++arc.idx) { - if (arc_is_dual(arc)) + for (struct arc arc = {.idx=0};arc.idx < max_num_arcs; ++arc.idx) { + if (arc_is_dual(graph, arc) || !arc_enabled(graph, arc)) continue; - assert(n < linear_network->max_num_arcs/2); + assert(n < max_num_arcs/2); u64_arr[n] = linear_network->arc_fee_cost[arc.idx]; double_arr[n] = linear_network->arc_prob_cost[arc.idx]; n++; @@ -539,10 +479,12 @@ static void combine_cost_function( * Scale by ratio of (positive) medians. */ const double k = get_median_ratio(working_ctx, linear_network); const double ln_30 = log(30); + const struct graph *graph = linear_network->graph; + const size_t max_num_arcs = graph_max_num_arcs(graph); - for(struct arc arc = {0};arc.idx < linear_network->max_num_arcs; ++arc.idx) + for(struct arc arc = {.idx=0};arc.idx < max_num_arcs; ++arc.idx) { - if(arc_tail(linear_network,arc)==INVALID_INDEX) + if (!arc_enabled(graph, arc)) continue; const double pcost = linear_network->arc_prob_cost[arc.idx]; @@ -573,21 +515,6 @@ static void combine_cost_function( } } -static void linear_network_add_adjacenct_arc( - struct linear_network *linear_network, - const u32 node_idx, - const struct arc arc) -{ - assert(arc.idx < linear_network->max_num_arcs); - linear_network->arc_tail_node[arc.idx] = node_idx; - - assert(node_idx < linear_network->max_num_nodes); - const struct arc first_arc = linear_network->node_adjacency_first_arc[node_idx]; - - linear_network->node_adjacency_next_arc[arc.idx]=first_arc; - linear_network->node_adjacency_first_arc[node_idx]=arc; -} - /* Get the fee cost associated to this directed channel. * Cost is expressed as PPM of the payment. * @@ -651,20 +578,8 @@ init_linear_network(const tal_t *ctx, const struct pay_parameters *params) const size_t max_num_arcs = max_num_chans * ARCS_PER_CHANNEL; const size_t max_num_nodes = gossmap_max_node_idx(gossmap); - linear_network->max_num_arcs = max_num_arcs; - linear_network->max_num_nodes = max_num_nodes; - - linear_network->arc_tail_node = tal_arr(linear_network,u32,max_num_arcs); - for(size_t i=0;iarc_tail_node[i]=INVALID_INDEX; - - linear_network->node_adjacency_next_arc = tal_arr(linear_network,struct arc,max_num_arcs); - for(size_t i=0;inode_adjacency_next_arc[i].idx=INVALID_INDEX; - - linear_network->node_adjacency_first_arc = tal_arr(linear_network,struct arc,max_num_nodes); - for(size_t i=0;inode_adjacency_first_arc[i].idx=INVALID_INDEX; + linear_network->graph = + graph_new(ctx, max_num_nodes, max_num_arcs, ARC_DUAL_BITOFF); linear_network->arc_prob_cost = tal_arr(linear_network,double,max_num_arcs); for(size_t i=0;igraph, arc, + node_obj(node_id), + node_obj(next_id)); linear_network->capacity[arc.idx] = capacity[k]; linear_network->arc_prob_cost[arc.idx] = prob_cost[k]; - linear_network->arc_fee_cost[arc.idx] = fee_cost; // + the respective dual - struct arc dual = arc_dual(arc); - - linear_network_add_adjacenct_arc(linear_network,next_id,dual); + struct arc dual = arc_dual(linear_network->graph, arc); linear_network->capacity[dual.idx] = 0; linear_network->arc_prob_cost[dual.idx] = -prob_cost[k]; - linear_network->arc_fee_cost[dual.idx] = -fee_cost; } } @@ -749,321 +663,6 @@ init_linear_network(const tal_t *ctx, const struct pay_parameters *params) return linear_network; } -// TODO(eduardo): unit test this -/* Finds an admissible path from source to target, traversing arcs in the - * residual network with capacity greater than 0. - * The path is encoded into prev, which contains the idx of the arcs that are - * traversed. */ - -/* Note we eschew tmpctx here, as this can be called multiple times! */ -static bool -find_admissible_path(const tal_t *working_ctx, - const struct linear_network *linear_network, - const struct residual_network *residual_network, - const u32 source, const u32 target, struct arc *prev) -{ - bool target_found = false; - /* Simple linear queue of node indexes */ - u32 *queue = tal_arr(working_ctx, u32, linear_network->max_num_arcs); - size_t qstart, qend, prev_len = tal_count(prev); - - for(size_t i=0;icap[arc.idx] <= 0) - continue; - - u32 next = arc_head(linear_network,arc); - - assert(next < prev_len); - - // if that node has been seen previously - if(prev[next].idx!=INVALID_INDEX) - continue; - - prev[next] = arc; - assert(qend < linear_network->max_num_arcs); - queue[qend++] = next; - } - } - return target_found; -} - -/* Get the max amount of flow one can send from source to target along the path - * encoded in `prev`. */ -static s64 get_augmenting_flow( - const struct linear_network* linear_network, - const struct residual_network *residual_network, - const u32 source, - const u32 target, - const struct arc *prev) -{ - s64 flow = INFINITE; - - u32 cur = target; - while(cur!=source) - { - assert(curcap[arc.idx]); - - // we are traversing in the opposite direction to the flow, - // hence the next node is at the tail of the arc. - cur = arc_tail(linear_network,arc); - } - - assert(flow0); - return flow; -} - -/* Augment a `flow` amount along the path defined by `prev`.*/ -static void augment_flow( - const struct linear_network *linear_network, - struct residual_network *residual_network, - const u32 source, - const u32 target, - const struct arc *prev, - s64 flow) -{ - u32 cur = target; - - while(cur!=source) - { - assert(cur < tal_count(prev)); - const struct arc arc = prev[cur]; - const struct arc dual = arc_dual(arc); - - assert(arc.idx < tal_count(residual_network->cap)); - assert(dual.idx < tal_count(residual_network->cap)); - - residual_network->cap[arc.idx] -= flow; - residual_network->cap[dual.idx] += flow; - - assert(residual_network->cap[arc.idx] >=0 ); - - // we are traversing in the opposite direction to the flow, - // hence the next node is at the tail of the arc. - cur = arc_tail(linear_network,arc); - } -} - - -// TODO(eduardo): unit test this -/* Finds any flow that satisfy the capacity and balance constraints of the - * uncertainty network. For the balance function condition we have: - * balance(source) = - balance(target) = amount - * balance(node) = 0 , for every other node - * Returns an error code if no feasible flow is found. - * - * 13/04/2023 This implementation uses a simple augmenting path approach. - * */ -static bool find_feasible_flow(const tal_t *working_ctx, - const struct linear_network *linear_network, - struct residual_network *residual_network, - const u32 source, const u32 target, s64 amount) -{ - assert(amount>=0); - - /* path information - * prev: is the id of the arc that lead to the node. */ - struct arc *prev = tal_arr(working_ctx,struct arc,linear_network->max_num_nodes); - - while(amount>0) - { - // find a path from source to target - if (!find_admissible_path(working_ctx, - linear_network, - residual_network, source, target, - prev)) { - return false; - } - - // traverse the path and see how much flow we can send - s64 delta = get_augmenting_flow(linear_network, - residual_network, - source,target,prev); - - // commit that flow to the path - delta = MIN(amount,delta); - assert(delta>0 && delta<=amount); - - augment_flow(linear_network,residual_network,source,target,prev,delta); - amount -= delta; - } - - return true; -} - -// TODO(eduardo): unit test this -/* Similar to `find_admissible_path` but use Dijkstra to optimize the distance - * label. Stops when the target is hit. */ -static bool find_optimal_path(const tal_t *working_ctx, - struct dijkstra *dijkstra, - const struct linear_network *linear_network, - const struct residual_network *residual_network, - const u32 source, const u32 target, - struct arc *prev) -{ - bool target_found = false; - - bitmap *visited = tal_arrz(working_ctx, bitmap, - BITMAP_NWORDS(linear_network->max_num_nodes)); - for(size_t i=0;icap[arc.idx] <= 0) - continue; - - u32 next = arc_head(linear_network,arc); - - s64 cij = residual_network->cost[arc.idx] - - residual_network->potential[cur] - + residual_network->potential[next]; - - // Dijkstra only works with non-negative weights - assert(cij>=0); - - if(distance[next]<=distance[cur]+cij) - continue; - - dijkstra_update(dijkstra,next,distance[cur]+cij); - prev[next]=arc; - } - } - - return target_found; -} - -/* Set zero flow in the residual network. */ -static void zero_flow( - const struct linear_network *linear_network, - struct residual_network *residual_network) -{ - for(u32 node=0;nodemax_num_nodes;++node) - { - residual_network->potential[node]=0; - for(struct arc arc=node_adjacency_begin(linear_network,node); - !node_adjacency_end(arc); - arc = node_adjacency_next(linear_network,arc)) - { - if(arc_is_dual(arc))continue; - - struct arc dual = arc_dual(arc); - - residual_network->cap[arc.idx] = linear_network->capacity[arc.idx]; - residual_network->cap[dual.idx] = 0; - } - } -} - -// TODO(eduardo): unit test this -/* Starting from a feasible flow (satisfies the balance and capacity - * constraints), find a solution that minimizes the network->cost function. - * - * TODO(eduardo) The MCF must be called several times until we get a good - * compromise between fees and probabilities. Instead of re-computing the MCF at - * each step, we might use the previous flow result, which is not optimal in the - * current iteration but I might be not too far from the truth. - * It comes to mind to use cycle cancelling. */ -static bool optimize_mcf(const tal_t *working_ctx, - struct dijkstra *dijkstra, - const struct linear_network *linear_network, - struct residual_network *residual_network, - const u32 source, const u32 target, const s64 amount) -{ - assert(amount>=0); - - zero_flow(linear_network,residual_network); - struct arc *prev = tal_arr(working_ctx,struct arc,linear_network->max_num_nodes); - - const s64 *const distance = dijkstra_distance_data(dijkstra); - - s64 remaining_amount = amount; - - while(remaining_amount>0) - { - if (!find_optimal_path(working_ctx, dijkstra, linear_network, - residual_network, source, target, prev)) { - return false; - } - - // traverse the path and see how much flow we can send - s64 delta = get_augmenting_flow(linear_network,residual_network,source,target,prev); - - // commit that flow to the path - delta = MIN(remaining_amount,delta); - assert(delta>0 && delta<=remaining_amount); - - augment_flow(linear_network,residual_network,source,target,prev,delta); - remaining_amount -= delta; - - // update potentials - for(u32 n=0;nmax_num_nodes;++n) - { - // see page 323 of Ahuja-Magnanti-Orlin - residual_network->potential[n] -= MIN(distance[target],distance[n]); - - /* Notice: - * if node i is permanently labeled we have - * d_i<=d_t - * which implies - * MIN(d_i,d_t) = d_i - * if node i is temporarily labeled we have - * d_i>=d_t - * which implies - * MIN(d_i,d_t) = d_t - * */ - } - } - return true; -} - // flow on directed channels struct chan_flow { @@ -1074,11 +673,11 @@ struct chan_flow * positive balance (returns a node idx with positive balance) * or we discover a cycle (returns a node idx with 0 balance). * */ -static u32 find_path_or_cycle( +static struct node find_path_or_cycle( const tal_t *working_ctx, const struct gossmap *gossmap, const struct chan_flow *chan_flow, - const u32 start_idx, + const struct node source, const s64 *balance, const struct gossmap_chan **prev_chan, @@ -1088,8 +687,8 @@ static u32 find_path_or_cycle( const size_t max_num_nodes = gossmap_max_node_idx(gossmap); bitmap *visited = tal_arrz(working_ctx, bitmap, BITMAP_NWORDS(max_num_nodes)); - u32 final_idx = start_idx; - bitmap_set_bit(visited, start_idx); + u32 final_idx = source.idx; + bitmap_set_bit(visited, final_idx); /* It is guaranteed to halt, because we either find a node with * balance[]>0 or we hit a node twice and we stop. */ @@ -1110,9 +709,9 @@ static u32 find_path_or_cycle( /* follow the flow */ if (chan_flow[c_idx].half[dir] > 0) { - const struct gossmap_node *next = + const struct gossmap_node *n = gossmap_nth_node(gossmap, c, !dir); - u32 next_idx = gossmap_node_idx(gossmap, next); + u32 next_idx = gossmap_node_idx(gossmap, n); prev_dir[next_idx] = dir; prev_chan[next_idx] = c; @@ -1135,7 +734,7 @@ static u32 find_path_or_cycle( } bitmap_set_bit(visited, updated_idx); } - return final_idx; + return node_obj(final_idx); } struct list_data @@ -1149,20 +748,21 @@ struct list_data * the channels allocation. */ static struct flow *substract_flow(const tal_t *ctx, const struct gossmap *gossmap, - const u32 start_idx, const u32 final_idx, + const struct node source, + const struct node sink, s64 *balance, struct chan_flow *chan_flow, const u32 *prev_idx, const int *prev_dir, const struct gossmap_chan *const *prev_chan) { - assert(balance[start_idx] < 0); - assert(balance[final_idx] > 0); - s64 delta = -balance[start_idx]; + assert(balance[source.idx] < 0); + assert(balance[sink.idx] > 0); + s64 delta = -balance[source.idx]; size_t length = 0; - delta = MIN(delta, balance[final_idx]); + delta = MIN(delta, balance[sink.idx]); /* We can only walk backwards, now get me the legth of the path and the * max flow we can send through this route. */ - for (u32 cur_idx = final_idx; cur_idx != start_idx; + for (u32 cur_idx = sink.idx; cur_idx != source.idx; cur_idx = prev_idx[cur_idx]) { assert(cur_idx != INVALID_INDEX); const int dir = prev_dir[cur_idx]; @@ -1183,9 +783,9 @@ static struct flow *substract_flow(const tal_t *ctx, /* Walk again and substract the flow value (delta). */ assert(delta > 0); - balance[start_idx] += delta; - balance[final_idx] -= delta; - for (u32 cur_idx = final_idx; cur_idx != start_idx; + balance[source.idx] += delta; + balance[sink.idx] -= delta; + for (u32 cur_idx = sink.idx; cur_idx != source.idx; cur_idx = prev_idx[cur_idx]) { const int dir = prev_dir[cur_idx]; const struct gossmap_chan *const chan = prev_chan[cur_idx]; @@ -1204,7 +804,8 @@ static struct flow *substract_flow(const tal_t *ctx, } /* Substract a flow cycle from the channel allocation. */ -static void substract_cycle(const struct gossmap *gossmap, const u32 final_idx, +static void substract_cycle(const struct gossmap *gossmap, + const struct node sink, struct chan_flow *chan_flow, const u32 *prev_idx, const int *prev_dir, const struct gossmap_chan *const *prev_chan) @@ -1213,7 +814,7 @@ static void substract_cycle(const struct gossmap *gossmap, const u32 final_idx, u32 cur_idx; /* Compute greatest flow in this cycle. */ - for (cur_idx = final_idx; cur_idx!=INVALID_INDEX;) { + for (cur_idx = sink.idx; cur_idx!=INVALID_INDEX;) { const int dir = prev_dir[cur_idx]; const struct gossmap_chan *const chan = prev_chan[cur_idx]; const u32 chan_idx = gossmap_chan_idx(gossmap, chan); @@ -1221,17 +822,17 @@ static void substract_cycle(const struct gossmap *gossmap, const u32 final_idx, delta = MIN(delta, chan_flow[chan_idx].half[dir]); cur_idx = prev_idx[cur_idx]; - if (cur_idx == final_idx) + if (cur_idx == sink.idx) /* we have come back full circle */ break; } - assert(cur_idx==final_idx); + assert(cur_idx==sink.idx); /* Walk again and substract the flow value (delta). */ assert(delta < INFINITE); assert(delta > 0); - for (cur_idx = final_idx;cur_idx!=INVALID_INDEX;) { + for (cur_idx = sink.idx;cur_idx!=INVALID_INDEX;) { const int dir = prev_dir[cur_idx]; const struct gossmap_chan *const chan = prev_chan[cur_idx]; const u32 chan_idx = gossmap_chan_idx(gossmap, chan); @@ -1239,11 +840,11 @@ static void substract_cycle(const struct gossmap *gossmap, const u32 final_idx, chan_flow[chan_idx].half[dir] -= delta; cur_idx = prev_idx[cur_idx]; - if (cur_idx == final_idx) + if (cur_idx == sink.idx) /* we have come back full circle */ break; } - assert(cur_idx==final_idx); + assert(cur_idx==sink.idx); } /* Given a flow in the residual network, build a set of payment flows in the @@ -1268,7 +869,7 @@ get_flow_paths(const tal_t *ctx, int *prev_dir = tal_arr(working_ctx,int,max_num_nodes); - u32 *prev_idx = tal_arr(working_ctx,u32,max_num_nodes); + u32 *prev_idx = tal_arr(working_ctx, u32, max_num_nodes); for (u32 node_idx = 0; node_idx < max_num_nodes; node_idx++) prev_idx[node_idx] = INVALID_INDEX; @@ -1276,56 +877,52 @@ get_flow_paths(const tal_t *ctx, // Convert the arc based residual network flow into a flow in the // directed channel network. // Compute balance on the nodes. - for(u32 n = 0;ngraph; + for (struct node n = {.idx = 0}; n.idx < max_num_nodes; n.idx++) { + for(struct arc arc = node_adjacency_begin(graph,n); !node_adjacency_end(arc); - arc = node_adjacency_next(linear_network,arc)) + arc = node_adjacency_next(graph,arc)) { - if(arc_is_dual(arc)) + if(arc_is_dual(graph, arc)) continue; - u32 m = arc_head(linear_network,arc); - s64 flow = get_arc_flow(residual_network,arc); + struct node m = arc_head(graph,arc); + s64 flow = get_arc_flow(residual_network, + graph, arc); u32 chanidx; int chandir; - balance[n] -= flow; - balance[m] += flow; + balance[n.idx] -= flow; + balance[m.idx] += flow; arc_to_parts(arc, &chanidx, &chandir, NULL, NULL); chan_flow[chanidx].half[chandir] +=flow; } - } // Select all nodes with negative balance and find a flow that reaches a // positive balance node. - for(u32 node_idx=0;node_idxgossmap, chan_flow, node_idx, balance, - prev_chan, prev_dir, prev_idx); + while (balance[source.idx] < 0) { + prev_chan[source.idx] = NULL; + struct node sink = find_path_or_cycle( + working_ctx, rq->gossmap, chan_flow, source, + balance, prev_chan, prev_dir, prev_idx); - if (balance[final_idx] > 0) + if (balance[sink.idx] > 0) /* case 1. found a path */ { struct flow *fp = substract_flow( - flows, rq->gossmap, node_idx, final_idx, - balance, chan_flow, prev_idx, prev_dir, - prev_chan); + flows, rq->gossmap, source, sink, balance, + chan_flow, prev_idx, prev_dir, prev_chan); tal_arr_expand(&flows, fp); } else /* case 2. found a cycle */ { - substract_cycle(rq->gossmap, final_idx, - chan_flow, prev_idx, prev_dir, - prev_chan); + substract_cycle(rq->gossmap, sink, chan_flow, + prev_idx, prev_dir, prev_chan); } } } @@ -1357,7 +954,6 @@ struct flow **minflow(const tal_t *ctx, * as we can be called multiple times without cleaning tmpctx! */ tal_t *working_ctx = tal(NULL, char); struct pay_parameters *params = tal(working_ctx, struct pay_parameters); - struct dijkstra *dijkstra; params->rq = rq; params->source = source; @@ -1373,9 +969,6 @@ struct flow **minflow(const tal_t *ctx, params->cost_fraction[i]= log((1-CHANNEL_PIVOTS[i-1])/(1-CHANNEL_PIVOTS[i])) /params->cap_fraction[i]; - - // printf("channel part: %ld, fraction: %lf, cost_fraction: %lf\n", - // i,params->cap_fraction[i],params->cost_fraction[i]); } params->delay_feefactor = delay_feefactor; @@ -1383,13 +976,14 @@ struct flow **minflow(const tal_t *ctx, // build the uncertainty network with linearization and residual arcs struct linear_network *linear_network= init_linear_network(working_ctx, params); + const struct graph *graph = linear_network->graph; + const size_t max_num_arcs = graph_max_num_arcs(graph); + const size_t max_num_nodes = graph_max_num_nodes(graph); struct residual_network *residual_network = - alloc_residual_network(working_ctx, linear_network->max_num_nodes, - linear_network->max_num_arcs); - dijkstra = dijkstra_new(working_ctx, gossmap_max_node_idx(rq->gossmap)); + alloc_residual_network(working_ctx, max_num_nodes, max_num_arcs); - const u32 target_idx = gossmap_node_idx(rq->gossmap,target); - const u32 source_idx = gossmap_node_idx(rq->gossmap,source); + const struct node dst = {.idx = gossmap_node_idx(rq->gossmap, target)}; + const struct node src = {.idx = gossmap_node_idx(rq->gossmap, source)}; init_residual_network(linear_network,residual_network); @@ -1409,20 +1003,25 @@ struct flow **minflow(const tal_t *ctx, * flow units. */ const u64 pay_amount_sats = (params->amount.millisatoshis + 999)/1000; /* Raw: minflow */ - if (!find_feasible_flow(working_ctx, linear_network, residual_network, - source_idx, target_idx, pay_amount_sats)) { - tal_free(working_ctx); - return NULL; + if (!simple_feasibleflow(working_ctx, linear_network->graph, src, dst, + residual_network->cap, pay_amount_sats)) { + rq_log(tmpctx, rq, LOG_INFORM, + "%s failed: unable to find a feasible flow.", __func__); + goto fail; } combine_cost_function(working_ctx, linear_network, residual_network, rq->biases, mu); /* We solve a linear MCF problem. */ - if(!optimize_mcf(working_ctx, dijkstra,linear_network,residual_network, - source_idx,target_idx,pay_amount_sats)) - { - tal_free(working_ctx); - return NULL; + if (!mcf_refinement(working_ctx, + linear_network->graph, + residual_network->excess, + residual_network->cap, + residual_network->cost, + residual_network->potential)) { + rq_log(tmpctx, rq, LOG_BROKEN, + "%s: MCF optimization step failed", __func__); + goto fail; } /* We dissect the solution of the MCF into payment routes. @@ -1430,6 +1029,16 @@ struct flow **minflow(const tal_t *ctx, * channel in the routes. */ flow_paths = get_flow_paths(ctx, working_ctx, rq, linear_network, residual_network); + if(!flow_paths){ + rq_log(tmpctx, rq, LOG_BROKEN, + "%s: failed to extract flow paths from the MCF solution", + __func__); + goto fail; + } tal_free(working_ctx); return flow_paths; + +fail: + tal_free(working_ctx); + return NULL; } From fa8c233720bb264c659fb50658fa070e76847f6a Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Mon, 21 Oct 2024 19:59:39 +0100 Subject: [PATCH 13/23] askrene: fix CI check the return value of scanf in askrene unit tests, Changelog-none: askrene: fix CI Signed-off-by: Lagrang3 --- plugins/askrene/mcf.c | 2 +- plugins/askrene/test/run-mcf-large.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/askrene/mcf.c b/plugins/askrene/mcf.c index 997dd50b6e83..a9e0d38f3e90 100644 --- a/plugins/askrene/mcf.c +++ b/plugins/askrene/mcf.c @@ -450,7 +450,7 @@ static double get_median_ratio(const tal_t *working_ctx, size_t n = 0; for (struct arc arc = {.idx=0};arc.idx < max_num_arcs; ++arc.idx) { - if (arc_is_dual(graph, arc) || !arc_enabled(graph, arc)) + if (arc_is_dual(graph, arc)) continue; assert(n < max_num_arcs/2); u64_arr[n] = linear_network->arc_fee_cost[arc.idx]; diff --git a/plugins/askrene/test/run-mcf-large.c b/plugins/askrene/test/run-mcf-large.c index 454874fca2fa..630f2fefd502 100644 --- a/plugins/askrene/test/run-mcf-large.c +++ b/plugins/askrene/test/run-mcf-large.c @@ -51,12 +51,14 @@ static int next_bit(s64 x) static bool solve_case(const tal_t *ctx) { + int ret; static int c = 0; c++; tal_t *this_ctx = tal(ctx, tal_t); int N_nodes, N_arcs; - myscanf("%d %d\n", &N_nodes, &N_arcs); + ret = myscanf("%d %d\n", &N_nodes, &N_arcs); + CHECK(ret == 2); printf("Testcase %d\n", c); printf("nodes %d arcs %d\n", N_nodes, N_arcs); if (N_nodes == 0 && N_arcs == 0) @@ -75,9 +77,9 @@ static bool solve_case(const tal_t *ctx) for (u32 i = 0; i < N_arcs; i++) { u32 from, to; - myscanf("%" PRIu32 " %" PRIu32 " %" PRIi64 " %" PRIi64, &from, - &to, &capacity[i], &cost[i]); - + ret = myscanf("%" PRIu32 " %" PRIu32 " %" PRIi64 " %" PRIi64, + &from, &to, &capacity[i], &cost[i]); + CHECK(ret == 4); struct arc arc = {.idx = i}; graph_add_arc(graph, arc, node_obj(from), node_obj(to)); @@ -89,7 +91,8 @@ static bool solve_case(const tal_t *ctx) struct node dst = {.idx = 1}; s64 amount, best_cost; - myscanf("%" PRIi64 " %" PRIi64, &amount, &best_cost); + ret = myscanf("%" PRIi64 " %" PRIi64, &amount, &best_cost); + CHECK(ret == 2); bool result = simple_mcf(ctx, graph, src, dst, capacity, amount, cost); CHECK(result); From b4e5bce7260dc76bc4440ae2b17900831596cb21 Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Tue, 22 Oct 2024 14:00:50 +0100 Subject: [PATCH 14/23] askrene: fix the median The calculation of the median values of probability and fee cost in the linear approximation had a bug by counting on non-existing arcs. Changelog-none: askrene: fix the median Signed-off-by: Lagrang3 --- plugins/askrene/mcf.c | 8 ++++++-- tests/test_askrene.py | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/askrene/mcf.c b/plugins/askrene/mcf.c index a9e0d38f3e90..da5ed08ac5f4 100644 --- a/plugins/askrene/mcf.c +++ b/plugins/askrene/mcf.c @@ -450,7 +450,8 @@ static double get_median_ratio(const tal_t *working_ctx, size_t n = 0; for (struct arc arc = {.idx=0};arc.idx < max_num_arcs; ++arc.idx) { - if (arc_is_dual(graph, arc)) + /* scan real arcs, not unused id slots or dual arcs */ + if (arc_is_dual(graph, arc) || !arc_enabled(graph, arc)) continue; assert(n < max_num_arcs/2); u64_arr[n] = linear_network->arc_fee_cost[arc.idx]; @@ -484,7 +485,7 @@ static void combine_cost_function( for(struct arc arc = {.idx=0};arc.idx < max_num_arcs; ++arc.idx) { - if (!arc_enabled(graph, arc)) + if (arc_is_dual(graph, arc) || !arc_enabled(graph, arc)) continue; const double pcost = linear_network->arc_prob_cost[arc.idx]; @@ -512,6 +513,9 @@ static void combine_cost_function( } else { residual_network->cost[arc.idx] = combined; } + /* and the respective dual */ + struct arc dual = arc_dual(graph, arc); + residual_network->cost[dual.idx] = -combined; } } diff --git a/tests/test_askrene.py b/tests/test_askrene.py index 2607beb6f384..b6e67f998ed8 100644 --- a/tests/test_askrene.py +++ b/tests/test_askrene.py @@ -552,6 +552,7 @@ def test_getroutes(node_factory): 'delay': 99 + 6}]]) +@pytest.mark.skip def test_getroutes_fee_fallback(node_factory): """Test getroutes call takes into account fees, if excessive""" @@ -998,6 +999,7 @@ def test_min_htlc_after_excess(node_factory, bitcoind): @pytest.mark.slow_test +@pytest.mark.skip def test_real_data(node_factory, bitcoind): # Route from Rusty's node to the top nodes # From tests/data/gossip-store-2024-09-22-node-map.xz: From 624edae6fec9cb88bafbf856dc610124515c6a96 Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Wed, 23 Oct 2024 11:16:30 +0100 Subject: [PATCH 15/23] add ratio ceil and floor operators on amount_msat Changelog-none: add ratio ceil and floor operators on amount_msat Signed-off-by: Lagrang3 --- common/amount.c | 10 ++++++++++ common/amount.h | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/common/amount.c b/common/amount.c index fe29eef91a71..a8730d2a3d89 100644 --- a/common/amount.c +++ b/common/amount.c @@ -516,6 +516,16 @@ double amount_msat_ratio(struct amount_msat a, struct amount_msat b) return (double)a.millisatoshis / b.millisatoshis; } +u64 amount_msat_ratio_floor(struct amount_msat a, struct amount_msat b) +{ + return a.millisatoshis / b.millisatoshis; +} + +u64 amount_msat_ratio_ceil(struct amount_msat a, struct amount_msat b) +{ + return (a.millisatoshis + b.millisatoshis - 1) / b.millisatoshis; +} + struct amount_msat amount_msat_div(struct amount_msat msat, u64 div) { msat.millisatoshis /= div; diff --git a/common/amount.h b/common/amount.h index 3070038c61f2..dd6ad61bb262 100644 --- a/common/amount.h +++ b/common/amount.h @@ -148,6 +148,12 @@ bool amount_msat_eq_sat(struct amount_msat msat, struct amount_sat sat); /* a / b */ double amount_msat_ratio(struct amount_msat a, struct amount_msat b); +/* floor(a/b) */ +u64 amount_msat_ratio_floor(struct amount_msat a, struct amount_msat b); + +/* ceil(a/b) */ +u64 amount_msat_ratio_ceil(struct amount_msat a, struct amount_msat b); + /* min(a,b) and max(a,b) */ static inline struct amount_msat amount_msat_min(struct amount_msat a, struct amount_msat b) From 4b842a14dd97a3e1945eafcbee45095239db9a84 Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Wed, 23 Oct 2024 11:19:32 +0100 Subject: [PATCH 16/23] askrene: add arbitrary precision flow unit Changelog-none: askrene: add arbitrary precision flow unit Signed-off-by: Lagrang3 --- plugins/askrene/mcf.c | 78 +++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/plugins/askrene/mcf.c b/plugins/askrene/mcf.c index da5ed08ac5f4..740b4fe4c921 100644 --- a/plugins/askrene/mcf.c +++ b/plugins/askrene/mcf.c @@ -286,6 +286,9 @@ struct pay_parameters { // how much we pay struct amount_msat amount; + /* base unit for computation, ie. accuracy */ + struct amount_msat accuracy; + // channel linearization parameters double cap_fraction[CHANNEL_PARTS], cost_fraction[CHANNEL_PARTS]; @@ -360,12 +363,13 @@ static void linearize_channel(const struct pay_parameters *params, if (amount_msat_greater(mincap, maxcap)) mincap = maxcap; - u64 a = mincap.millisatoshis/1000, /* Raw: linearize_channel */ - b = 1 + maxcap.millisatoshis/1000; /* Raw: linearize_channel */ + u64 a = amount_msat_ratio_floor(mincap, params->accuracy), + b = 1 + amount_msat_ratio_floor(maxcap, params->accuracy); /* An extra bound on capacity, here we use it to reduce the flow such * that it does not exceed htlcmax. */ - u64 cap_on_capacity = fp16_to_u64(c->half[dir].htlc_max) / 1000; + u64 cap_on_capacity = + amount_msat_ratio_floor(gossmap_chan_htlc_max(c, dir), params->accuracy); set_capacity(&capacity[0], a, &cap_on_capacity); cost[0]=0; @@ -373,9 +377,9 @@ static void linearize_channel(const struct pay_parameters *params, { set_capacity(&capacity[i], params->cap_fraction[i]*(b-a), &cap_on_capacity); - cost[i] = params->cost_fraction[i] - *params->amount.millisatoshis /* Raw: linearize_channel */ - /(b-a); + cost[i] = params->cost_fraction[i] * 1000 + * amount_msat_ratio(params->amount, params->accuracy) + / (b - a); } } @@ -528,7 +532,7 @@ static void combine_cost_function( * * into * - * fee_microsat = c_fee * x_sat + * fee = c_fee/10^6 * x * * use `base_fee_penalty` to weight the base fee and `delay_feefactor` to * weight the CLTV delay. @@ -557,21 +561,24 @@ struct amount_msat linear_flow_cost(const struct flow *flow, double delay_feefactor) { struct amount_msat msat_cost; - s64 cost = 0; + s64 cost_ppm = 0; double base_fee_penalty = base_fee_penalty_estimate(total_amount); for (size_t i = 0; i < tal_count(flow->path); i++) { const struct half_chan *h = &flow->path[i]->half[flow->dirs[i]]; - cost += linear_fee_cost(h->base_fee, h ->proportional_fee, h->delay, - base_fee_penalty, delay_feefactor); + cost_ppm += + linear_fee_cost(h->base_fee, h->proportional_fee, h->delay, + base_fee_penalty, delay_feefactor); } - - if (!amount_msat_mul(&msat_cost, flow->delivers, cost)) + if (!amount_msat_fee(&msat_cost, flow->delivers, 0, cost_ppm)) abort(); return msat_cost; } +/* FIXME: Instead of mapping one-to-one the indexes in the gossmap, try to + * reduce the number of nodes and arcs used by taking only those that are + * enabled. We might save some cpu if the work with a pruned network. */ static struct linear_network * init_linear_network(const tal_t *ctx, const struct pay_parameters *params) { @@ -629,6 +636,7 @@ init_linear_network(const tal_t *ctx, const struct pay_parameters *params) // that are outgoing to `node` linearize_channel(params, c, half, capacity, prob_cost); + /* linear fee_cost per unit of flow */ const s64 fee_cost = linear_fee_cost( c->half[half].base_fee, c->half[half].proportional_fee, @@ -751,13 +759,14 @@ struct list_data * balance, compute the bigest flow and substract it from the nodes balance and * the channels allocation. */ static struct flow *substract_flow(const tal_t *ctx, - const struct gossmap *gossmap, + const struct pay_parameters *params, const struct node source, const struct node sink, s64 *balance, struct chan_flow *chan_flow, const u32 *prev_idx, const int *prev_dir, const struct gossmap_chan *const *prev_chan) { + const struct gossmap *gossmap = params->rq->gossmap; assert(balance[source.idx] < 0); assert(balance[sink.idx] > 0); s64 delta = -balance[source.idx]; @@ -803,7 +812,8 @@ static struct flow *substract_flow(const tal_t *ctx, chan_flow[chan_idx].half[dir] -= delta; } - f->delivers = amount_msat(delta * 1000); + if (!amount_msat_mul(&f->delivers, params->accuracy, delta)) + abort(); return f; } @@ -856,16 +866,16 @@ static void substract_cycle(const struct gossmap *gossmap, static struct flow ** get_flow_paths(const tal_t *ctx, const tal_t *working_ctx, - const struct route_query *rq, + const struct pay_parameters *params, const struct linear_network *linear_network, const struct residual_network *residual_network) { struct flow **flows = tal_arr(ctx,struct flow*,0); - const size_t max_num_chans = gossmap_max_chan_idx(rq->gossmap); + const size_t max_num_chans = gossmap_max_chan_idx(params->rq->gossmap); struct chan_flow *chan_flow = tal_arrz(working_ctx,struct chan_flow,max_num_chans); - const size_t max_num_nodes = gossmap_max_node_idx(rq->gossmap); + const size_t max_num_nodes = gossmap_max_node_idx(params->rq->gossmap); s64 *balance = tal_arrz(working_ctx,s64,max_num_nodes); const struct gossmap_chan **prev_chan @@ -911,21 +921,21 @@ get_flow_paths(const tal_t *ctx, while (balance[source.idx] < 0) { prev_chan[source.idx] = NULL; struct node sink = find_path_or_cycle( - working_ctx, rq->gossmap, chan_flow, source, + working_ctx, params->rq->gossmap, chan_flow, source, balance, prev_chan, prev_dir, prev_idx); if (balance[sink.idx] > 0) /* case 1. found a path */ { struct flow *fp = substract_flow( - flows, rq->gossmap, source, sink, balance, + flows, params, source, sink, balance, chan_flow, prev_idx, prev_dir, prev_chan); tal_arr_expand(&flows, fp); } else /* case 2. found a cycle */ { - substract_cycle(rq->gossmap, sink, chan_flow, + substract_cycle(params->rq->gossmap, sink, chan_flow, prev_idx, prev_dir, prev_chan); } } @@ -963,6 +973,10 @@ struct flow **minflow(const tal_t *ctx, params->source = source; params->target = target; params->amount = amount; + params->accuracy = AMOUNT_MSAT(1000); + /* FIXME: params->accuracy = amount_msat_max(amount_msat_div(amount, + * 1000), AMOUNT_MSAT(1)); + * */ // template the channel partition into linear arcs params->cap_fraction[0]=0; @@ -991,24 +1005,14 @@ struct flow **minflow(const tal_t *ctx, init_residual_network(linear_network,residual_network); - /* TODO(eduardo): - * Some MCF algorithms' performance depend on the size of maxflow. If we - * were to work in units of msats we 1. risking overflow when computing - * costs and 2. we risk a performance overhead for no good reason. - * - * Working in units of sats was my first choice, but maybe working in - * units of 10, or 100 sats could be even better. - * - * IDEA: define the size of our precision as some parameter got at - * runtime that depends on the size of the payment and adjust the MCF - * accordingly. - * For example if we are trying to pay 1M sats our precision could be - * set to 1000sat, then channels that had capacity for 3M sats become 3k - * flow units. */ - const u64 pay_amount_sats = (params->amount.millisatoshis + 999)/1000; /* Raw: minflow */ + /* Since we have constraint accuracy, ask to find a payment solution + * that can pay a bit more than the actual value rathen than undershoot it. + * That's why we use the ceil function here. */ + const u64 pay_amount = + amount_msat_ratio_ceil(params->amount, params->accuracy); if (!simple_feasibleflow(working_ctx, linear_network->graph, src, dst, - residual_network->cap, pay_amount_sats)) { + residual_network->cap, pay_amount)) { rq_log(tmpctx, rq, LOG_INFORM, "%s failed: unable to find a feasible flow.", __func__); goto fail; @@ -1031,7 +1035,7 @@ struct flow **minflow(const tal_t *ctx, /* We dissect the solution of the MCF into payment routes. * Actual amounts considering fees are computed for every * channel in the routes. */ - flow_paths = get_flow_paths(ctx, working_ctx, rq, + flow_paths = get_flow_paths(ctx, working_ctx, params, linear_network, residual_network); if(!flow_paths){ rq_log(tmpctx, rq, LOG_BROKEN, From 90491102744e3bf6b06282918cc81d41a0e4761f Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Tue, 12 Nov 2024 08:52:47 +0100 Subject: [PATCH 17/23] askrene: small fixes suggested by Rusty Russell - use graph_max_num_arcs/nodes instead of tal_count in bound checks, - don't use ccan/lqueue, use instead a minimalistic queue implementation with an array, - add missing const qualifiers to temporary tal allocators, - check preconditions with assert, - remove inline specifier for static functions, Changelog-None Signed-off-by: Lagrang3 --- plugins/askrene/algorithm.c | 129 ++++++++++++--------------- plugins/askrene/graph.c | 8 +- plugins/askrene/graph.h | 8 +- plugins/askrene/test/run-mcf-large.c | 2 +- 4 files changed, 66 insertions(+), 81 deletions(-) diff --git a/plugins/askrene/algorithm.c b/plugins/askrene/algorithm.c index 13345e74a91b..2e07983aa55e 100644 --- a/plugins/askrene/algorithm.c +++ b/plugins/askrene/algorithm.c @@ -1,6 +1,5 @@ #include "config.h" #include -#include #include #include #include @@ -10,44 +9,37 @@ static const s64 INFINITE = INT64_MAX; #define MAX(x, y) (((x) > (y)) ? (x) : (y)) #define MIN(x, y) (((x) < (y)) ? (x) : (y)) -/* Simple queue to traverse the network. */ -struct queue_data { - u32 idx; - struct lqueue_link ql; -}; - bool BFS_path(const tal_t *ctx, const struct graph *graph, const struct node source, const struct node destination, const s64 *capacity, const s64 cap_threshold, struct arc *prev) { - tal_t *this_ctx = tal(ctx, tal_t); + const tal_t *this_ctx = tal(ctx, tal_t); bool target_found = false; + assert(graph); const size_t max_num_arcs = graph_max_num_arcs(graph); const size_t max_num_nodes = graph_max_num_nodes(graph); /* check preconditions */ - if (!graph || source.idx >= max_num_nodes || !capacity || !prev) - goto finish; - - if (tal_count(capacity) != max_num_arcs || - tal_count(prev) != max_num_nodes) - goto finish; + assert(source.idx < max_num_nodes); + assert(capacity); + assert(prev); + assert(tal_count(capacity) == max_num_arcs); + assert(tal_count(prev) == max_num_nodes); for (size_t i = 0; i < max_num_nodes; i++) prev[i].idx = INVALID_INDEX; - LQUEUE(struct queue_data, ql) myqueue = LQUEUE_INIT; - struct queue_data *qdata; + /* A minimalistic queue is implemented here. Nodes are not visited more + * than once, therefore a maximum size of max_num_nodes is sufficient. + * max_num_arcs would work as well but we expect max_num_arcs to be a + * factor >10 greater than max_num_nodes. */ + u32 *queue = tal_arr(this_ctx, u32, max_num_nodes); + size_t queue_start = 0, queue_end = 0; - qdata = tal(this_ctx, struct queue_data); - qdata->idx = source.idx; - lqueue_enqueue(&myqueue, qdata); + queue[queue_end++] = source.idx; - while (!lqueue_empty(&myqueue)) { - qdata = lqueue_dequeue(&myqueue); - struct node cur = {.idx = qdata->idx}; - - tal_free(qdata); + while (queue_start < queue_end) { + struct node cur = {.idx = queue[queue_start++]}; if (cur.idx == destination.idx) { target_found = true; @@ -69,13 +61,11 @@ bool BFS_path(const tal_t *ctx, const struct graph *graph, prev[next.idx] = arc; - qdata = tal(this_ctx, struct queue_data); - qdata->idx = next.idx; - lqueue_enqueue(&myqueue, qdata); + assert(queue_end < max_num_nodes); + queue[queue_end++] = next.idx; } } -finish: tal_free(this_ctx); return target_found; } @@ -87,24 +77,25 @@ bool dijkstra_path(const tal_t *ctx, const struct graph *graph, s64 *distance) { bool target_found = false; + assert(graph); const size_t max_num_arcs = graph_max_num_arcs(graph); const size_t max_num_nodes = graph_max_num_nodes(graph); - tal_t *this_ctx = tal(ctx, tal_t); + const tal_t *this_ctx = tal(ctx, tal_t); /* check preconditions */ - if (!graph || source.idx >=max_num_nodes || !cost || !capacity || - !prev || !distance) - goto finish; + assert(source.idx=max_num_nodes && prune) - goto finish; + assert(destination.idx < max_num_nodes || !prune); - if (tal_count(cost) != max_num_arcs || - tal_count(capacity) != max_num_arcs || - tal_count(prev) != max_num_nodes || - tal_count(distance) != max_num_nodes) - goto finish; + assert(tal_count(cost) == max_num_arcs); + assert(tal_count(capacity) == max_num_arcs); + assert(tal_count(prev) == max_num_nodes); + assert(tal_count(distance) == max_num_nodes); /* FIXME: maybe this is unnecessary */ bitmap *visited = tal_arrz(this_ctx, bitmap, @@ -217,9 +208,8 @@ static s64 get_augmenting_flow(const struct graph *graph, * Sends an amount of flow through an arc, changing the flow balance of the * nodes connected by the arc and the [residual] capacity of the arc and its * dual. */ -static inline void sendflow(const struct graph *graph, const struct arc arc, - const s64 flow, s64 *arc_capacity, - s64 *node_balance) +static void sendflow(const struct graph *graph, const struct arc arc, + const s64 flow, s64 *arc_capacity, s64 *node_balance) { const struct arc dual = arc_dual(graph, arc); @@ -279,20 +269,17 @@ bool simple_feasibleflow(const tal_t *ctx, s64 *capacity, s64 amount) { - tal_t *this_ctx = tal(ctx, tal_t); + const tal_t *this_ctx = tal(ctx, tal_t); + assert(graph); const size_t max_num_arcs = graph_max_num_arcs(graph); const size_t max_num_nodes = graph_max_num_nodes(graph); /* check preconditions */ - if (amount < 0) - goto finish; - - if (!graph || source.idx >= max_num_nodes || - destination.idx >= max_num_nodes || !capacity) - goto finish; - - if (tal_count(capacity) != max_num_arcs) - goto finish; + assert(amount > 0); + assert(source.idx < max_num_nodes); + assert(destination.idx < max_num_nodes); + assert(capacity); + assert(tal_count(capacity) == max_num_arcs); /* path information * prev: is the id of the arc that lead to the node. */ @@ -343,8 +330,8 @@ s64 node_balance(const struct graph *graph, /* Helper. * Compute the reduced cost of an arc. */ -static inline s64 reduced_cost(const struct graph *graph, const struct arc arc, - const s64 *cost, const s64 *potential) +static s64 reduced_cost(const struct graph *graph, const struct arc arc, + const s64 *cost, const s64 *potential) { struct node src = arc_tail(graph, arc); struct node dst = arc_head(graph, arc); @@ -368,7 +355,7 @@ static struct node dijkstra_nearest_sink(const tal_t *ctx, s64 *distance) { struct node target = {.idx = INVALID_INDEX}; - tal_t *this_ctx = tal(ctx, tal_t); + const tal_t *this_ctx = tal(ctx, tal_t); if (!this_ctx) /* bad allocation */ @@ -521,7 +508,7 @@ bool mcf_refinement(const tal_t *ctx, s64 *potential) { bool solved = false; - tal_t *this_ctx = tal(ctx, tal_t); + const tal_t *this_ctx = tal(ctx, tal_t); if (!this_ctx) /* bad allocation */ @@ -639,24 +626,23 @@ bool simple_mcf(const tal_t *ctx, const struct graph *graph, const struct node source, const struct node destination, s64 *capacity, s64 amount, const s64 *cost) { - tal_t *this_ctx = tal(ctx, tal_t); + const tal_t *this_ctx = tal(ctx, tal_t); if (!this_ctx) /* bad allocation */ goto fail; - if (!graph) - goto fail; - + assert(graph); const size_t max_num_arcs = graph_max_num_arcs(graph); const size_t max_num_nodes = graph_max_num_nodes(graph); - if (amount < 0 || source.idx >= max_num_nodes || - destination.idx >= max_num_nodes || !capacity || !cost) - goto fail; - - if (tal_count(capacity) != max_num_arcs || - tal_count(cost) != max_num_arcs) - goto fail; + /* check preconditions */ + assert(amount > 0); + assert(source.idx < max_num_nodes); + assert(destination.idx < max_num_nodes); + assert(capacity); + assert(cost); + assert(tal_count(capacity) == max_num_arcs); + assert(tal_count(cost) == max_num_arcs); s64 *potential = tal_arrz(this_ctx, s64, max_num_nodes); s64 *excess = tal_arrz(this_ctx, s64, max_num_nodes); @@ -681,12 +667,15 @@ bool simple_mcf(const tal_t *ctx, const struct graph *graph, s64 flow_cost(const struct graph *graph, const s64 *capacity, const s64 *cost) { + assert(graph); const size_t max_num_arcs = graph_max_num_arcs(graph); s64 total_cost = 0; - assert(graph && capacity && cost); - assert(tal_count(capacity) == max_num_arcs && - tal_count(cost) == max_num_arcs); + /* check preconditions */ + assert(capacity); + assert(cost); + assert(tal_count(capacity) == max_num_arcs); + assert(tal_count(cost) == max_num_arcs); for (u32 i = 0; i < max_num_arcs; i++) { struct arc arc = {.idx = i}; diff --git a/plugins/askrene/graph.c b/plugins/askrene/graph.c index a38f4a98ea16..250cdd7df7dc 100644 --- a/plugins/askrene/graph.c +++ b/plugins/askrene/graph.c @@ -5,7 +5,8 @@ static void graph_push_outbound_arc(struct graph *graph, const struct arc arc, const struct node node) { - assert(arc.idx < tal_count(graph->arc_tail)); + assert(arc.idx < graph_max_num_arcs(graph)); + assert(node.idx < graph_max_num_nodes(graph)); /* arc is already added, skip */ if (graph->arc_tail[arc.idx].idx != INVALID_INDEX) @@ -13,13 +14,8 @@ static void graph_push_outbound_arc(struct graph *graph, const struct arc arc, graph->arc_tail[arc.idx] = node; - assert(node.idx < tal_count(graph->node_adjacency_first)); const struct arc first_arc = graph->node_adjacency_first[node.idx]; - - assert(arc.idx < tal_count(graph->node_adjacency_next)); graph->node_adjacency_next[arc.idx] = first_arc; - - assert(node.idx < tal_count(graph->node_adjacency_first)); graph->node_adjacency_first[node.idx] = arc; } diff --git a/plugins/askrene/graph.h b/plugins/askrene/graph.h index 3407826d8f02..e84ed131b938 100644 --- a/plugins/askrene/graph.h +++ b/plugins/askrene/graph.h @@ -84,7 +84,7 @@ static inline bool arc_is_dual(const struct graph *graph, struct arc arc) static inline struct node arc_tail(const struct graph *graph, const struct arc arc) { - assert(arc.idx < tal_count(graph->arc_tail)); + assert(arc.idx < graph_max_num_arcs(graph)); return graph->arc_tail[arc.idx]; } @@ -93,7 +93,7 @@ static inline struct node arc_head(const struct graph *graph, const struct arc arc) { const struct arc dual = arc_dual(graph, arc); - assert(dual.idx < tal_count(graph->arc_tail)); + assert(dual.idx < graph_max_num_arcs(graph)); return graph->arc_tail[dual.idx]; } @@ -122,7 +122,7 @@ static inline bool arc_enabled(const struct graph *graph, const struct arc arc) static inline struct arc node_adjacency_begin(const struct graph *graph, const struct node node) { - assert(node.idx < tal_count(graph->node_adjacency_first)); + assert(node.idx < graph_max_num_nodes(graph)); return graph->node_adjacency_first[node.idx]; } static inline bool node_adjacency_end(const struct arc arc) @@ -132,7 +132,7 @@ static inline bool node_adjacency_end(const struct arc arc) static inline struct arc node_adjacency_next(const struct graph *graph, const struct arc arc) { - assert(arc.idx < tal_count(graph->node_adjacency_next)); + assert(arc.idx < graph_max_num_arcs(graph)); return graph->node_adjacency_next[arc.idx]; } diff --git a/plugins/askrene/test/run-mcf-large.c b/plugins/askrene/test/run-mcf-large.c index 630f2fefd502..1d9aa3a5c585 100644 --- a/plugins/askrene/test/run-mcf-large.c +++ b/plugins/askrene/test/run-mcf-large.c @@ -54,7 +54,7 @@ static bool solve_case(const tal_t *ctx) int ret; static int c = 0; c++; - tal_t *this_ctx = tal(ctx, tal_t); + const tal_t *this_ctx = tal(ctx, tal_t); int N_nodes, N_arcs; ret = myscanf("%d %d\n", &N_nodes, &N_arcs); From 963d59ee48f9c93dda20aab34fc4fede4200bdcd Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Wed, 13 Nov 2024 09:26:28 +0100 Subject: [PATCH 18/23] askrene: add compiler flag ASKRENE_UNITTEST Rusty: "We don't generally use NDEBUG in our code" Instead use a compile time flag ASKRENE_UNITTEST to make checks on unit tests that we don't normally need on release code. Changelog-none Signed-off-by: Lagrang3 --- plugins/askrene/algorithm.c | 6 +++--- plugins/askrene/test/run-bfs.c | 1 + plugins/askrene/test/run-dijkstra.c | 1 + plugins/askrene/test/run-flow.c | 1 + plugins/askrene/test/run-graph.c | 1 + plugins/askrene/test/run-mcf-large.c | 1 + plugins/askrene/test/run-mcf.c | 1 + plugins/askrene/test/run-pqueue.c | 2 +- 8 files changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/askrene/algorithm.c b/plugins/askrene/algorithm.c index 2e07983aa55e..c843a218a766 100644 --- a/plugins/askrene/algorithm.c +++ b/plugins/askrene/algorithm.c @@ -402,7 +402,7 @@ static struct node dijkstra_nearest_sink(const tal_t *ctx, prev[i].idx = INVALID_INDEX; /* Only in debug mode we keep track of visited nodes. */ -#ifndef NDEBUG +#ifdef ASKRENE_UNITTEST bitmap *visited = tal_arrz(this_ctx, bitmap, BITMAP_NWORDS(max_num_nodes)); assert(visited); @@ -421,7 +421,7 @@ static struct node dijkstra_nearest_sink(const tal_t *ctx, priorityqueue_pop(q); /* Only in debug mode we keep track of visited nodes. */ -#ifndef NDEBUG +#ifdef ASKRENE_UNITTEST assert(!bitmap_test_bit(visited, cur.idx)); bitmap_set_bit(visited, cur.idx); #endif @@ -598,7 +598,7 @@ bool mcf_refinement(const tal_t *ctx, } } -#ifndef NDEBUG +#ifdef ASKRENE_UNITTEST /* verify that we have satisfied all constraints */ for (u32 i = 0; i < max_num_nodes; i++) { assert(excess[i] == 0); diff --git a/plugins/askrene/test/run-bfs.c b/plugins/askrene/test/run-bfs.c index 529ff5832448..5c5f0a045a89 100644 --- a/plugins/askrene/test/run-bfs.c +++ b/plugins/askrene/test/run-bfs.c @@ -6,6 +6,7 @@ #include #include +#define ASKRENE_UNITTEST #include "../algorithm.c" #define MAX_NODES 256 diff --git a/plugins/askrene/test/run-dijkstra.c b/plugins/askrene/test/run-dijkstra.c index 4c2e9cd39b12..3c82e48c03e1 100644 --- a/plugins/askrene/test/run-dijkstra.c +++ b/plugins/askrene/test/run-dijkstra.c @@ -6,6 +6,7 @@ #include #include +#define ASKRENE_UNITTEST #include "../algorithm.c" // 1->2 7 diff --git a/plugins/askrene/test/run-flow.c b/plugins/askrene/test/run-flow.c index ead35db7c8df..0f1eaba8f8ff 100644 --- a/plugins/askrene/test/run-flow.c +++ b/plugins/askrene/test/run-flow.c @@ -6,6 +6,7 @@ #include #include +#define ASKRENE_UNITTEST #include "../algorithm.c" #define MAX_NODES 256 diff --git a/plugins/askrene/test/run-graph.c b/plugins/askrene/test/run-graph.c index 3c6d4c945ec5..c1017e66619e 100644 --- a/plugins/askrene/test/run-graph.c +++ b/plugins/askrene/test/run-graph.c @@ -6,6 +6,7 @@ #include #include +#define ASKRENE_UNITTEST #include "../graph.c" #define MAX_NODES 10 diff --git a/plugins/askrene/test/run-mcf-large.c b/plugins/askrene/test/run-mcf-large.c index 1d9aa3a5c585..ad521956fd59 100644 --- a/plugins/askrene/test/run-mcf-large.c +++ b/plugins/askrene/test/run-mcf-large.c @@ -6,6 +6,7 @@ #include #include +#define ASKRENE_UNITTEST #include "../algorithm.c" #ifdef HAVE_ZLIB diff --git a/plugins/askrene/test/run-mcf.c b/plugins/askrene/test/run-mcf.c index e06ae3752e74..aacb51c92ea0 100644 --- a/plugins/askrene/test/run-mcf.c +++ b/plugins/askrene/test/run-mcf.c @@ -6,6 +6,7 @@ #include #include +#define ASKRENE_UNITTEST #include "../algorithm.c" #define CHECK(arg) if(!(arg)){fprintf(stderr, "failed CHECK at line %d: %s\n", __LINE__, #arg); abort();} diff --git a/plugins/askrene/test/run-pqueue.c b/plugins/askrene/test/run-pqueue.c index a6f8e2454cd8..bd7850b935a3 100644 --- a/plugins/askrene/test/run-pqueue.c +++ b/plugins/askrene/test/run-pqueue.c @@ -5,7 +5,7 @@ #include #include - +#define ASKRENE_UNITTEST #include "../priorityqueue.c" #define CHECK(arg) if(!(arg)){fprintf(stderr, "failed CHECK at line %d: %s\n", __LINE__, #arg); abort();} From b925b665bc21183307412c3915da6645b524612a Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Wed, 13 Nov 2024 09:35:14 +0100 Subject: [PATCH 19/23] askrene: remove allocation checks Rusty: "allocations don't fail" Signed-off-by: Lagrang3 --- plugins/askrene/algorithm.c | 21 --------------------- plugins/askrene/graph.c | 10 ---------- 2 files changed, 31 deletions(-) diff --git a/plugins/askrene/algorithm.c b/plugins/askrene/algorithm.c index c843a218a766..8901c4b3549d 100644 --- a/plugins/askrene/algorithm.c +++ b/plugins/askrene/algorithm.c @@ -101,10 +101,6 @@ bool dijkstra_path(const tal_t *ctx, const struct graph *graph, bitmap *visited = tal_arrz(this_ctx, bitmap, BITMAP_NWORDS(max_num_nodes)); - if (!visited) - /* bad allocation */ - goto finish; - for (size_t i = 0; i < max_num_nodes; ++i) prev[i].idx = INVALID_INDEX; @@ -158,7 +154,6 @@ bool dijkstra_path(const tal_t *ctx, const struct graph *graph, for (size_t i = 0; i < max_num_nodes; i++) distance[i] = dijkstra_distance[i]; -finish: tal_free(this_ctx); return target_found; } @@ -357,10 +352,6 @@ static struct node dijkstra_nearest_sink(const tal_t *ctx, struct node target = {.idx = INVALID_INDEX}; const tal_t *this_ctx = tal(ctx, tal_t); - if (!this_ctx) - /* bad allocation */ - goto finish; - /* check preconditions */ assert(graph); assert(node_balance); @@ -405,7 +396,6 @@ static struct node dijkstra_nearest_sink(const tal_t *ctx, #ifdef ASKRENE_UNITTEST bitmap *visited = tal_arrz(this_ctx, bitmap, BITMAP_NWORDS(max_num_nodes)); - assert(visited); #endif struct priorityqueue *q; @@ -510,10 +500,6 @@ bool mcf_refinement(const tal_t *ctx, bool solved = false; const tal_t *this_ctx = tal(ctx, tal_t); - if (!this_ctx) - /* bad allocation */ - goto finish; - assert(graph); assert(excess); assert(capacity); @@ -627,9 +613,6 @@ bool simple_mcf(const tal_t *ctx, const struct graph *graph, s64 *capacity, s64 amount, const s64 *cost) { const tal_t *this_ctx = tal(ctx, tal_t); - if (!this_ctx) - /* bad allocation */ - goto fail; assert(graph); const size_t max_num_arcs = graph_max_num_arcs(graph); @@ -647,10 +630,6 @@ bool simple_mcf(const tal_t *ctx, const struct graph *graph, s64 *potential = tal_arrz(this_ctx, s64, max_num_nodes); s64 *excess = tal_arrz(this_ctx, s64, max_num_nodes); - if (!potential || !excess) - /* bad allocation */ - goto fail; - excess[source.idx] = amount; excess[destination.idx] = -amount; diff --git a/plugins/askrene/graph.c b/plugins/askrene/graph.c index 250cdd7df7dc..973e6adcc365 100644 --- a/plugins/askrene/graph.c +++ b/plugins/askrene/graph.c @@ -42,10 +42,6 @@ struct graph *graph_new(const tal_t *ctx, const size_t max_num_nodes, struct graph *graph; graph = tal(ctx, struct graph); - /* bad allocation of graph */ - if (!graph) - return graph; - graph->max_num_arcs = max_num_arcs; graph->max_num_nodes = max_num_nodes; graph->arc_dual_bit = arc_dual_bit; @@ -56,12 +52,6 @@ struct graph *graph_new(const tal_t *ctx, const size_t max_num_nodes, graph->node_adjacency_next = tal_arr(graph, struct arc, graph->max_num_arcs); - /* bad allocation of graph components */ - if (!graph->arc_tail || !graph->node_adjacency_first || - !graph->node_adjacency_next) { - return tal_free(graph); - } - /* initialize with invalid indexes so that we know these slots have * never been used, eg. arc/node is newly created */ for (size_t i = 0; i < graph->max_num_arcs; i++) From d8225122a8789a63669671f374fcce2122ac40dc Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Wed, 13 Nov 2024 10:54:32 +0100 Subject: [PATCH 20/23] askrene: bugfix queue overflow Changelog-none Signed-off-by: Lagrang3 --- plugins/askrene/algorithm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/askrene/algorithm.c b/plugins/askrene/algorithm.c index 8901c4b3549d..d253325a8b23 100644 --- a/plugins/askrene/algorithm.c +++ b/plugins/askrene/algorithm.c @@ -56,7 +56,8 @@ bool BFS_path(const tal_t *ctx, const struct graph *graph, const struct node next = arc_head(graph, arc); /* if that node has been seen previously */ - if (prev[next.idx].idx != INVALID_INDEX) + if (prev[next.idx].idx != INVALID_INDEX || + next.idx == source.idx) continue; prev[next.idx] = arc; From 62cfdbafe53fb9bccd29e07c5a55c57aba4bd7a7 Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Wed, 13 Nov 2024 11:20:13 +0100 Subject: [PATCH 21/23] askrene: don't skip fee_fallback test The fee_fallback test would fail after fixing the computation of the median. Now by we can restore it by making the probability cost factor 1000x higher than the ratio of the median. This shows how hard it is to combine fee and probability costs and why is the current approach so fragile. Changelog-None Signed-off-by: Lagrang3 --- plugins/askrene/mcf.c | 2 +- tests/test_askrene.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/askrene/mcf.c b/plugins/askrene/mcf.c index 740b4fe4c921..1dd5d359595f 100644 --- a/plugins/askrene/mcf.c +++ b/plugins/askrene/mcf.c @@ -482,7 +482,7 @@ static void combine_cost_function( { /* probabilty and fee costs are not directly comparable! * Scale by ratio of (positive) medians. */ - const double k = get_median_ratio(working_ctx, linear_network); + const double k = 1000 * get_median_ratio(working_ctx, linear_network); const double ln_30 = log(30); const struct graph *graph = linear_network->graph; const size_t max_num_arcs = graph_max_num_arcs(graph); diff --git a/tests/test_askrene.py b/tests/test_askrene.py index b6e67f998ed8..f6c25ad8624f 100644 --- a/tests/test_askrene.py +++ b/tests/test_askrene.py @@ -552,7 +552,6 @@ def test_getroutes(node_factory): 'delay': 99 + 6}]]) -@pytest.mark.skip def test_getroutes_fee_fallback(node_factory): """Test getroutes call takes into account fees, if excessive""" From e0790bb9776b741e0a0bf21b36557b1d52138b2a Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Thu, 14 Nov 2024 14:32:43 +0100 Subject: [PATCH 22/23] Askrene: change median factor to 1. The ratio of the median of the fees and probability cost is overall not a bad factor to combine these two features. This is what the test_real_data shows. Changelog-None Signed-off-by: Lagrang3 --- plugins/askrene/mcf.c | 2 +- tests/test_askrene.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/askrene/mcf.c b/plugins/askrene/mcf.c index 1dd5d359595f..740b4fe4c921 100644 --- a/plugins/askrene/mcf.c +++ b/plugins/askrene/mcf.c @@ -482,7 +482,7 @@ static void combine_cost_function( { /* probabilty and fee costs are not directly comparable! * Scale by ratio of (positive) medians. */ - const double k = 1000 * get_median_ratio(working_ctx, linear_network); + const double k = get_median_ratio(working_ctx, linear_network); const double ln_30 = log(30); const struct graph *graph = linear_network->graph; const size_t max_num_arcs = graph_max_num_arcs(graph); diff --git a/tests/test_askrene.py b/tests/test_askrene.py index f6c25ad8624f..b0941125cab6 100644 --- a/tests/test_askrene.py +++ b/tests/test_askrene.py @@ -552,6 +552,7 @@ def test_getroutes(node_factory): 'delay': 99 + 6}]]) +@pytest.mark.skip def test_getroutes_fee_fallback(node_factory): """Test getroutes call takes into account fees, if excessive""" @@ -998,7 +999,6 @@ def test_min_htlc_after_excess(node_factory, bitcoind): @pytest.mark.slow_test -@pytest.mark.skip def test_real_data(node_factory, bitcoind): # Route from Rusty's node to the top nodes # From tests/data/gossip-store-2024-09-22-node-map.xz: @@ -1038,10 +1038,10 @@ def test_real_data(node_factory, bitcoind): # CI, it's slow. if SLOW_MACHINE: limit = 25 - expected = (4, 25, 1533317, 143026, 91) + expected = (6, 25, 1544756, 142986, 91) else: limit = 100 - expected = (8, 95, 6007785, 564997, 91) + expected = (9, 95, 6347877, 566288, 92) fees = {} for n in range(0, limit): @@ -1155,10 +1155,10 @@ def test_real_biases(node_factory, bitcoind): # CI, it's slow. if SLOW_MACHINE: limit = 25 - expected = ({1: 4, 2: 5, 4: 7, 8: 11, 16: 14, 32: 19, 64: 25, 100: 25}, 0) + expected = ({1: 5, 2: 7, 4: 7, 8: 11, 16: 14, 32: 19, 64: 25, 100: 25}, 0) else: limit = 100 - expected = ({1: 19, 2: 25, 4: 36, 8: 51, 16: 66, 32: 81, 64: 96, 100: 96}, 0) + expected = ({1: 23, 2: 31, 4: 40, 8: 53, 16: 70, 32: 82, 64: 96, 100: 96}, 0) l1.rpc.askrene_create_layer('biases') num_changed = {} @@ -1202,8 +1202,8 @@ def amount_through_chan(chan, routes): if route2 != route: # It should have avoided biassed channel amount_after = amount_through_chan(chan, route2['routes']) - assert amount_after < amount_before - num_changed[bias] += 1 + if amount_after < amount_before: + num_changed[bias] += 1 # Undo bias l1.rpc.askrene_bias_channel(layer='biases', short_channel_id_dir=chan, bias=0) From 6795ff3358ae8c1bc49d88631eb0977cae282544 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 21 Nov 2024 14:03:37 +1030 Subject: [PATCH 23/23] pytest: reenable askrene bias test. We can fix the median calc by removing the (unused) reverse edges. Also analyze the failure case in test_real_data: it's a real edge case, so hardcode that one as "ok". Signed-off-by: Rusty Russell --- tests/test_askrene.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/test_askrene.py b/tests/test_askrene.py index b0941125cab6..580215a70653 100644 --- a/tests/test_askrene.py +++ b/tests/test_askrene.py @@ -552,22 +552,26 @@ def test_getroutes(node_factory): 'delay': 99 + 6}]]) -@pytest.mark.skip def test_getroutes_fee_fallback(node_factory): """Test getroutes call takes into account fees, if excessive""" # 0 -> 1 -> 3: high capacity, high fee (1%) # 0 -> 2 -> 3: low capacity, low fee. + # (We disable reverse, since it breaks median calc!) gsfile, nodemap = generate_gossip_store([GenChannel(0, 1, capacity_sats=20000, - forward=GenChannel.Half(propfee=10000)), + forward=GenChannel.Half(propfee=10000), + reverse=GenChannel.Half(enabled=False)), GenChannel(0, 2, - capacity_sats=10000), + capacity_sats=10000, + reverse=GenChannel.Half(enabled=False)), GenChannel(1, 3, capacity_sats=20000, - forward=GenChannel.Half(propfee=10000)), + forward=GenChannel.Half(propfee=10000), + reverse=GenChannel.Half(enabled=False)), GenChannel(2, 3, - capacity_sats=10000)]) + capacity_sats=10000, + reverse=GenChannel.Half(enabled=False))]) # Set up l1 with this as the gossip_store l1 = node_factory.get_node(gossip_store_file=gsfile.name) @@ -1204,6 +1208,13 @@ def amount_through_chan(chan, routes): amount_after = amount_through_chan(chan, route2['routes']) if amount_after < amount_before: num_changed[bias] += 1 + else: + # We bias -4 against 83x88x31908/0 going to node 83, and this is violated. + # Both routes contain three paths, all via 83x88x31908/0. + # The first amounts 49490584, 1018832, 49490584, + # The second amounts 25254708, 25254708, 49490584, + # Due to fees and rounding, we actually spend 1msat more on the second case! + assert (n, bias, chan) == (83, 4, '83x88x31908/0') # Undo bias l1.rpc.askrene_bias_channel(layer='biases', short_channel_id_dir=chan, bias=0)