Update of hasValidNetwork, and implementations of formsClusters and alpha-beta prunning