CAIRO — President Mahmoud Ahmadinejad traveled to Cairo on Tuesday, the first visit by an Iranian leader to Egypt since the two countries broke off diplomatic relations three decades ago and a barometer of the shifts in regional dynamics underway since the start of the Arab uprisings.