Abelian factors in 2-step nilpotent Lie algebras constructed from graphs