Have you checked them? good articles to tackle these mind boggling issues.
http://www.cocos2d-x.org/wiki/Physics#Collision
http://www.iforce2d.net/b2dtut/collision-filtering
if you can implement collision grouping system from box2d then please do share them i also need them
for my next prototype.