added new testing algorithm for spanningtree