From a layperson perspective maybe something like Fermat's Principle is what you are curious about. It also seems one can usually encode/send combinatorial problems into some other space or representation and decode them back into the discrete world. Generating functions and such.