
    Џkht                     F    d Z ddlZddlmZ ddlmZ ddlmZ ddl	m
Z
 d Zy)z'Test the minimum spanning tree function    N)assert_)	csr_array)minimum_spanning_treec                     g dg dg dg dg dg} t        j                  |       } g dg dg dg dg dg}t        j                  |      }t        |       }t        |      }|j	                         }t        j                  ||d	       t        j                  |j	                         | d
       t        |d      }t        j                  |j	                         |d       t         j                  j                  d       dD ]  }dt         j                  j                  ||f      z   } t        |       }t        |      }t        |j                  |k         t        j                  |dz
        }d| ||dz   f<   t        |       }t        |      }t        j                  ||f      }d|||dz   f<   t        j                  |j	                         |d	        y )N)r      r   r   r   )r   r   r   r   r   )r   r   r         )r   r   r   r   r   )r   r   r	   r   r   )r   r   r   r   r   )r   r   r   r   r	   )r   r   r   r   r   zIncorrect spanning tree found.zOriginal graph was modified.T)	overwritez/Graph was not properly modified to contain MST.i  )r	   
            r   )npasarrayr   r   toarraynptassert_array_equalrandomseedr   nnzarangezeros)graphexpectedcsgraphmintreemintree_arrayNidxs          i/var/www/teggl/fontify/venv/lib/python3.12/site-packages/scipy/sparse/csgraph/tests/test_spanning_tree.pytest_minimum_spanning_treer!   	   s    	E
 JJuE 	H
 zz(#H G#G,GOO%M=(;= 7??,e&( $Gt<G7??,h9; IINN4 . BII$$aV,,E" (0a  ii!nc#a%iE"'0 88QF# c!ew0(,	.+.    )__doc__numpyr   numpy.testingr   testingr   scipy.sparser   scipy.sparse.csgraphr   r!    r"   r    <module>r*      s    -  !  " 69.r"   