The gunman who killed 10 people and wounded several others in Sweden may have been connected with the adult education centre where he opened fire, police have said.