Do relay nodes need to have money in order to relay transactions? Imagine Alice wants to send 0.5 btc to Bob. They both open channels with Carol, a relay node that has no money. They create single funded channels each of 1 btc.

Now Alice updates her channel to be 0.5 to her and 0.5 to Carol (nevermind LN fees for now).

To relay this 0.5 to Bob, Carol (the relay node) needs to update her channel with Bob to be also be 0.5 her and 0.5 Bob. But she doesn't have any money on her side to do this. All the money is on Bob's side -- as I said earlier, Carol doesn't have any money.

What's the workaround for this? Do relay nodes need to have money to relay transactions?
No, there is no work around for this. If a channel's balance is completely allocated to one side, the channel can only be used to move funds in one direction. Additionally, a channel whose balance is shifted completely to one side is vulnerable to the broadcast of a previous channel state as there are no funds to be lost for the attacker. This does not apply to channels that are unilaterally funded, since no previous channel state exists in that case.

It is therefore not recommended to exhaust a channel completely in one direction. To maintain liquidity in both directions, proposed approaches are to charge increased fees as channels get further out of balance, and to charge lower fees, possibly even negative fees, in the direction that moves a channel back towards equilibrium.

Routing algorithms that minimize the fee for a route would thus be incentivized to help rebalance routes along the path. Additionally, this means that cycles can exist in the graph that actually incur in sum a negative fee, which any member of that cycle could collect by initiating a payment to themselves along the cycle to the collective benefit.



Update: It follows an example for using a cycle to rebalance channels.

Take the three payment channels

Alice 0.8 : 0.2 Bob 
  Bob 0.7 : 0.3 Carol
Carol 0.9 : 0.1 Alice


Alice notices the cycle, and creates a three hop payment that pays 0.3 BTC to herself by route of Bob and Carol. She crafts the HTLC, and sends it to Bob, Bob accepts and forwards to Carol, Carol accepts and forwards to Alice. Alice executes the last hop, Carol the middle and Bob pulls in the locked funds from Alice resulting in more balanced channels for everyone.

Alice 0.5 : 0.5 Bob 
  Bob 0.4 : 0.6 Carol
Carol 0.6 : 0.4 Alice


Note that Bob and Carol do not know that Alice paid to herself as they can each only see the next hop and previous hop in the contract chain.