This is really a simple concept: cagers can't collide with you if they aren't anywhere close to you. So, as much as you can, ride where the traffic isn't.
But you might want a little more detail.
I think that cagers and bikers will agree traffic sucks. It's slow, there are impatient drivers everywhere, and it gets dangerous quick. Driving a car at any time, as you know, sucks. A little traffic might make it suck a little more, but you've still got that baseline level of suck even in light traffic.
Riding a motorcycle, on the other hand, is always awesome. However, bad traffic has a definite, negative impact on the quality of the ride. So although it's always better than a car, some rides are certainly less enjoyable than others.
Which is where the logic of my route selection comes in. In a car, along with millions of other drivers, I almost always choose the shortest, most direct, or simply fastest route.
On the bike, I choose the route with the least traffic on it, even if riding that route takes more time than the direct route. I enjoy riding, so a little more time on the bike is hardly a bad thing. And staying out of traffic increases my enjoyment of the ride, while decreasing my chances of getting creamed by an inattentive asshat watching a movie in his or her SUV.
There is a route I can take home from work, for example, that cuts five to ten minutes off of my ride. The downside is that the on ramp takes me straight into a nasty snarl of traffic that, frankly, stresses me out. I've witnessed several accidents and had too many close calls to feel comfortable riding there. So I take the slower way, with fewer cars on it, and have more fun.
To summarize all this: when choosing your route, choose the path of least resistance. If you are able, just stay away from traffic. Allow a little more time, if you need to. It's worth it.