<oembed><type>rich</type><version>1.0</version><author_name>npub1aslmpzentw224n3s6yccru4dq2qdlx7rfudfnqevfck637cjt6esswfqmx</author_name><author_url>https://nostr.ae/npub1aslmpzentw224n3s6yccru4dq2qdlx7rfudfnqevfck637cjt6esswfqmx</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;Hi Rene,&#xA;&#xA;&#xA;&gt; First I am happy that you also agree that reliability can and should be&#xA;&gt; expressed as a probability as discussed in [0].&#xA;&gt;&#xA;&#xA;Probability based routing is not new to me. I&#39;ve implemented a form of that&#xA;in lnd in march 2019: https://github.com/lightningnetwork/lnd/pull/2802,&#xA;followed by several rounds of refinement.&#xA;&#xA;&#xA;&gt; The problem that you address is that of feature engineering[1]. Which&#xA;&gt; consists of two (or even more) steps:&#xA;&gt;&#xA;&gt; 1.) Feature selection: That means in payment delivery we will compute a&#xA;&gt; min cost flow [2] with a chosen cost function (historically people used&#xA;&gt; dijkstra seach for single paths with the cost function representing the&#xA;&gt; weights on the edges of the graph -which is what most folks currently still&#xA;&gt; do). While [2] and I personally agree with you that the cost function&#xA;&gt; should be a combination the two features fees and reliability (as in&#xA;&gt; successprobability) Matt Corallo righfully pointed out [3] that other&#xA;&gt; features might be chosen in the future to deliver more optimal results. For&#xA;&gt; example implementations currently often use CLTV as a feature (which I&#xA;&gt; honestly find horrible) and I am currently investigating if one could add&#xA;&gt; latency of channels or - for known IP addresses - either the geo distance&#xA;&gt; or IP distance.&#xA;&gt;&#xA;&#xA;I am aware that there are more candidate features, but my question is&#xA;specifically about the ones that I mentioned.&#xA;&#xA;2.) Combining features: This is the question that you are asking. Often&#xA;&gt; people use a linear weighted sum to combine features. This is what often&#xA;&gt; happens implicitly in neural networks. While this is often good enough and&#xA;&gt; while it is often practical to either learn the weights or give users a&#xA;&gt; choice there are many situation where the weighted linear sum does not work&#xA;&gt; well with the selected features. An example for the weighted sum is the&#xA;&gt; risk-factor in c-lightning that could have been used to decide if one&#xA;&gt; wanted the dijkstra seach to either optimize for CLTV delta or for paid&#xA;&gt; routing fees. Also in our paper [2] in which we discuss the same two&#xA;&gt; features that you mentioned we explain how a linear sum of two features can&#xA;&gt; be optimal due to the lagrangian bounding principle. However in practice&#xA;&gt; (of machine learning) it has been shown that using the harmonic mean [4]&#xA;&gt; between features often works very well without the necessity to learn a&#xA;&gt; weight / parameter. This has for example been done when c-lightnign&#xA;&gt; recently switched to probabilistic path finding [5]. In this thread you&#xA;&gt; find a long discussion and evaluation how the harmonic mean outperformed&#xA;&gt; the linear sum.&#xA;&gt;&#xA;&#xA;Obviously features can be combined in a multitude of ways, but I am looking&#xA;for something that is anchored to some kind of understandable starting&#xA;point. What I did in lnd is to work with so called &#39;payment attempt cost&#39;.&#xA;A virtual satoshi amount that represents the cost of a failed attempt. If&#xA;you put a high price on failed attempts, pathfinding will tend towards more&#xA;reliable routes even if they require a higher fee. To me, the idea of&#xA;putting a (virtual) cost on a payment attempt is tangible and ideally the&#xA;math should follow from that. I don&#39;t want zero parameters, because I think&#xA;that ultimately the fee/reliability trade-off is up to the user to decide&#xA;on.&#xA;&#xA;Joost&#xA;&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20211115/0be67f54/attachment.html&gt;</html></oembed>