<oembed><type>rich</type><version>1.0</version><author_name>npub1zlxd3xlzjhq2ue03e5m5p2w6mp8v3dkhq5r39flsftjjsje04wvsdd2k4w</author_name><author_url>https://nostr.ae/npub1zlxd3xlzjhq2ue03e5m5p2w6mp8v3dkhq5r39flsftjjsje04wvsdd2k4w</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2021-11-15&#xA;📝 Original message:&#xA;Dear Joost,&#xA;&#xA;First I am happy that you also agree that reliability can and should be&#xA;expressed as a probability as discussed in [0].&#xA;&#xA;The problem that you address is that of feature engineering[1]. Which&#xA;consists of two (or even more) steps:&#xA;&#xA;1.) Feature selection: That means in payment delivery we will compute a min&#xA;cost flow [2] with a chosen cost function (historically people used&#xA;dijkstra seach for single paths with the cost function representing the&#xA;weights on the edges of the graph -which is what most folks currently still&#xA;do). While [2] and I personally agree with you that the cost function&#xA;should be a combination the two features fees and reliability (as in&#xA;successprobability) Matt Corallo righfully pointed out [3] that other&#xA;features might be chosen in the future to deliver more optimal results. For&#xA;example implementations currently often use CLTV as a feature (which I&#xA;honestly find horrible) and I am currently investigating if one could add&#xA;latency of channels or - for known IP addresses - either the geo distance&#xA;or IP distance.&#xA;&#xA;2.) Combining features: This is the question that you are asking. Often&#xA;people use a linear weighted sum to combine features. This is what often&#xA;happens implicitly in neural networks. While this is often good enough and&#xA;while it is often practical to either learn the weights or give users a&#xA;choice there are many situation where the weighted linear sum does not work&#xA;well with the selected features. An example for the weighted sum is the&#xA;risk-factor in c-lightning that could have been used to decide if one&#xA;wanted the dijkstra seach to either optimize for CLTV delta or for paid&#xA;routing fees. Also in our paper [2] in which we discuss the same two&#xA;features that you mentioned we explain how a linear sum of two features can&#xA;be optimal due to the lagrangian bounding principle. However in practice&#xA;(of machine learning) it has been shown that using the harmonic mean [4]&#xA;between features often works very well without the necessity to learn a&#xA;weight / parameter. This has for example been done when c-lightnign&#xA;recently switched to probabilistic path finding [5]. In this thread you&#xA;find a long discussion and evaluation how the harmonic mean outperformed&#xA;the linear sum.&#xA;&#xA;I think the main issue that you address here is that there is no universal&#xA;truth for situations like this. In practice only tests and experience will&#xA;help us to make good decisions.&#xA;&#xA;with kind Regards Rene&#xA;&#xA;[0]:&#xA;https://lists.linuxfoundation.org/pipermail/lightning-dev/2021-March/002984.html&#xA;[1]: https://en.wikipedia.org/wiki/Feature_engineering&#xA;[2]: https://arxiv.org/abs/2107.05322&#xA;[3]:&#xA;https://lists.linuxfoundation.org/pipermail/lightning-dev/2021-September/003219.html&#xA;[4]:  https://en.wikipedia.org/wiki/Harmonic_mean&#xA;[5]: https://github.com/ElementsProject/lightning/pull/4771&#xA;&#xA;&#xA;&#xA;&#xA;On Mon, Nov 15, 2021 at 4:26 PM Joost Jager &lt;joost.jager at gmail.com&gt; wrote:&#xA;&#xA;&gt; In Lightning pathfinding the two main variables to optimize for are&#xA;&gt; routing fee and reliability. Routing fee is concrete. It is the sat amount&#xA;&gt; that is paid when a payment succeeds. Reliability is a property of a route&#xA;&gt; that can be expressed as a probability. The probability that a route will&#xA;&gt; be successful.&#xA;&gt;&#xA;&gt; During pathfinding, route options are compared against each other. So for&#xA;&gt; example:&#xA;&gt;&#xA;&gt; Route A: fee 10 sat, success probability 50%&#xA;&gt; Route B: fee 20 sat, success probability 80%&#xA;&gt;&#xA;&gt; Which one is the better route? That depends on user preference. A patient&#xA;&gt; user will probably go for route A in the hope of saving on fees whereas for&#xA;&gt; a time-sensitive payment route B looks better.&#xA;&gt;&#xA;&gt; It would be great to offer this trade-off to the user in a simple way.&#xA;&gt; Preferably a single [0, 1] value that controls the selection process. At 0,&#xA;&gt; the route is only optimized for fees and probabilities are ignored&#xA;&gt; completely. At 1, the route is only optimized for reliability and fees are&#xA;&gt; ignored completely.&#xA;&gt;&#xA;&gt; But how to choose between the routes A and B for a value somewhere in&#xA;&gt; between 0 and 1? For example 0.5 - perfect balance between reliability and&#xA;&gt; fee. But what does that mean exactly?&#xA;&gt;&#xA;&gt; Anyone got an idea on how to approach this best? I am looking for a simple&#xA;&gt; formula to decide between routes, preferably with a reasonably sound&#xA;&gt; probability-theoretical basis (whatever that means).&#xA;&gt;&#xA;&gt; Joost&#xA;&gt; _______________________________________________&#xA;&gt; Lightning-dev mailing list&#xA;&gt; Lightning-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#xA;&gt;&#xA;&#xA;&#xA;-- &#xA;https://www.rene-pickhardt.de&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20211115/392fcbf0/attachment-0001.html&gt;</html></oembed>