Sum-Product Network structure learning by efficient product nodes discovery