in 2016, cruz and kasich actually made a deal to tell each other's voters to vote for the other one in states they weren't strong in. i don't remember exactly where it was, but they were down to the three of them. kasich could have maybe won some northern state, and cruz could have maybe won some western state. so, the deal was that cruz voters would vote for kasich in the northern state, and kasich voters would vote for cruz in the western state.
this fell apart, partly because the deal didn't really make a lot of sense - i would actually expect most kasich voters to prefer trump over cruz.
but, it was the closest thing i've seen yet to candidates figuring this out, in the context of american politics.
in canada, we actually have vote swapping exchanges, and we have what we call "strategic voting". it's efficacy is questionable, and it sometimes leads to unexpected outcomes (like trudeau's majority in 2015, which was built on strategic voting....the polls all showed minorities) but it's the right approach to solve the problem, at least.