While walking on a path, sometimes two person try to dodge each other. Like one guy steps left, and at the same time, other guy steps left and then switches direction and so does the other guy. Is there a word to describe this?
This is called a droitwich.
From The Meaning of Liff by Douglas Adams and John Lloyd:
DROITWICH (n.) A street dance. The two partners approach from opposite directions and try politely to get out of each other's way. They step to the left, step to the right, apologise, step to the left again, apologise again, bump into each other and repeat as often as unnecessary.
The Meaning of Liff is a humorous work of fiction in which the names of British towns are given alternative meanings. This definition of droitwich also has an entry in urban dictionary along with notable alternatives: the pavement tango and the get-past-you shuffle.
One term that was proposed for this is "avoidancing."
There isn't a specific English word for this awkward situation. In the right circumstances it might be a type of physical comedy, but that's not the specific answer you are after, I'm afraid.
I've heard it called a "sidewalk gavotte."
In certain geek subcultures, it’s referred to as symmetry-breaking; I don’t know how widespread this usage is.
(In more detail: I’ve heard this often among mathematicians and physicists. It wouldn’t be understood completely out of context, since symmetry-breaking is really a technical term for a much more general phenomenon, but it would be understood in a situation like “I met so-and-so in the corridor the other day; we spent about ten seconds symmetry-breaking.” More usually, when you find yourself actually doing this dance, you break the awkwardness by looking up, catching the other’s eye, and muttering “Symmetry-breaking!” with a wry chuckle; this usually helps bring the ritual to an end. Unless, of course, your partner has made this observation at just the same moment…)
P. S. R.
Parallel Synchronized Randomness. "An interesting brain rarity and our subject for today. Two people walk in opposite directions at the same time and then they make the same decision at the same time. Then they correct it, and then they correct it, and then they correct it, and then they correct it, and then they correct it. Basically, in a mathematical world these two little guys will stay looped for the end of time. The brain is the most complex thing in the universe and it's right behind the nose"
- The Science of Sleep by Michel Gondry