smartest dogs= Border collies
Rhodesian Ridgebacks may give them a run for their money.
RR's were bred in Africa to hunt lions, so I suppose intelligence was an important trait to cultivate -- the dumber ones would get themselves killed pretty quickly.
I knew a woman who had two she kept in her backyard, which was surrounded by a seven-foot wood fence.
She tried every gate latch known to man, but the dogs figured out them all and kept letting themselves out. The only thing that worked was a combination lock.
So rather than going out the gate, they went over the wall, passing a test that's often used for primates -- they pushed various things from the backyard up against the fence until they had built a "stairway" high enough to let them hop over the fence...