Optimizing edge selection from a list of numbers
k, 48 43 38 bytes

-5 bytes thanks to ngn.

{a@*&gt;*+a:x{(+/x*1+&lt;y*|!#x;y)}/:+!2|-x}


Try it online! It simply tries all possibilities, and chooses the first one with the maximum value. Left/right encoded as 0/1.

{                                    } /functions accepts x
                               +!2|-x  /all possible selections
          { +/x*1+&lt;y*|!#x   }          /calculate the total sum
           (             ;y)           /also record the selection with each sum
         x                   /:        /map over all selections
 a@*&gt;*+a:                              /choose the one with max total sum


This can probably be golfed further.