As far as I understand, Terragen traces the flow of data in the network *backward*. So it looks at the end shaders, which themselves "query" any shaders that are connected to their inputs, which then flows "back" through the network. So if something is not connected to any kind of renderable element, e.g an object, surface, atmosphere, etc., then it shouldn't be calculated. It's still ideal to clean up node networks of unused nodes though.
- Oshyan