You don't greet a stranger but at the same time it's rude not to greet someone you know,
Gosh, this is one of the most dreadful situations I experience when I go out. Do I greet them and risk getting ignored, or ignore them and look like a snob? Is there even some sort of etiquette to this?
Kudos to you for putting it into exact words.