Yes constipation can be relieved by use of over the counter magnesium citrate.
The magnesium supplement is an osmotic laxative that relaxes your bowels and pulls in water through your intestines and the water then softens up your poop which makes it easier for you to poop.
Whenever I have constipation and nothing else seems to work I take some Magnesium Supplements as a last resort and it does get the bowels moving for me pretty quickly.