+
    /i&                        ^ RI t^ RIHt ^ RIt^ RIHtHtHt ^ RI	H
t
 ^ RIHtHtHt RR.tR tR	 tR
 tR tR t]P*                  P-                  R]4      ]P*                  P-                  R. RO4      R 4       4       t]P*                  P-                  R]4      ]P*                  P-                  R. RO4      R 4       4       t]P*                  P-                  R]4      R 4       t]P*                  P-                  R]4      R 4       t]P*                  P-                  R]4      R 4       t]P*                  P-                  R]4      R 4       t]P*                  P-                  R]4      R 4       t]P*                  P-                  R]4      R 4       t]P*                  P-                  R]4      R 4       t]P*                  P-                  R. .. 3^ .^ ... 3. RO. R O. R!O.. R"O3. R#O. R$O. R O.. R%O3.4      R 4       t ]P*                  P-                  R. .. 3^ ... 3^..^ .3^ ^.^
^ ..^^ .3. RO. R&O. R'O.. R(O3.4      R 4       t!]P*                  P-                  R. .. 3^ ... 3^..^ .3^ ^.^
^ ..^ ^.3. RO. R&O. R'O.. R)O3.4      R 4       t"R# )*    N)assert_array_equal)	csr_array	csc_array
csr_matrix)maximum_flow)_add_reverse_edges_make_edge_pointers_make_tailsedmonds_karpdinicc            	          \         P                  ! \        4      ;_uu_ 4        \        P                  ! ^ ^.^ ^ ..4      p \        V ^ ^4       \        V ^ ^RR7       RRR4       R#   + '       g   i     R# ; ir   r   methodN)pytestraises	TypeErrornparrayr   graphs    b/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/sparse/csgraph/tests/test_flow.pytest_raises_on_dense_inputr      sU    	y	!	!1a&1a&)*UAq!UAq8 
"	!	!	!s   9A&&A7	c            	          \         P                  ! \        4      ;_uu_ 4        \        ^ ^.^ ^ ..4      p \	        V ^ ^4       \	        V ^ ^RR7       RRR4       R#   + '       g   i     R# ; ir   )r   r   r   r   r   r   s    r   test_raises_on_csc_inputr      sQ    	y	!	!Aq6Aq6*+UAq!UAq8 
"	!	!	!   .AA,	c            	          \         P                  ! \        4      ;_uu_ 4        \        ^ R.^ ^ ..\        P
                  R7      p \        V ^ ^4       \        V ^ ^RR7       RRR4       R#   + '       g   i     R# ; i)r   g      ?dtyper   r   N)r   r   
ValueErrorr   r   float64r   r   s    r   #test_raises_on_floating_point_inputr"      sW    	z	"	"As8aV,BJJ?UAq!UAq8 
#	"	"	"s   >A++A<	c                      \         P                  ! \        4      ;_uu_ 4        \        . RO. RO.4      p \	        V ^ ^4       RRR4       R#   + '       g   i     R# ; i)r   N)r         )r%   r$   r   r   r   r    r   r   r   s    r   test_raises_on_non_square_inputr'   "   s;    	z	"	"9i01UAq! 
#	"	"	"s   AA	c            	          \         P                  ! \        4      ;_uu_ 4        \        ^ ^.^ ^ ..4      p \	        V ^ ^ 4       \	        V ^ ^ RR7       RRR4       R#   + '       g   i     R# ; ir   r&   r   s    r   test_raises_when_source_is_sinkr)   (   sQ    	z	"	"Aq6Aq6*+UAq!UAq8 
#	"	"	"r   r   sourcec           	          \         P                  ! \        4      ;_uu_ 4        \        ^ ^.^ ^ ..4      p\	        W ^VR7       RRR4       R#   + '       g   i     R# ; ir   r   Nr&   )r*   r   r   s   && r   (test_raises_when_source_is_out_of_boundsr-   /   sE     
z	"	"Aq6Aq6*+UAf5 
#	"	"	"    AA	sinkc           	          \         P                  ! \        4      ;_uu_ 4        \        ^ ^.^ ^ ..4      p\	        V^ WR7       RRR4       R#   + '       g   i     R# ; ir,   r&   )r/   r   r   s   && r   &test_raises_when_sink_is_out_of_boundsr1   7   sE     
z	"	"Aq6Aq6*+UAt3 
#	"	"	"r.   c                     \        ^ ^.^ ^ ..4      p\        V^ ^V R7      pVP                  ^8X  g   Q h\        P                  ! ^ ^.R^ ..4      p\        VP                  P                  4       V4       R# )r   r   Nr   r   
flow_valuer   r   r   flowtoarrayr   r   resexpected_flows   &   r   test_simple_graphr;   ?   so     1v1v&'E
ua6
2C>>QHHq!fr1g./Msxx'')=9    c           	         \        ^ ^.^ ^ ..4      p\        \        V^ ^V R7      P                  \         4      '       g   Q h\	        ^ ^.^ ^ ..4      p\        \        V^ ^V R7      P                  \        4      '       g   Q hR# r,   )r   
isinstancer   r6   r   )r   r   s   & r   test_return_typer?   J   sx    1v1v&'El5!Qv>CCYOOOOAA'(El5!Qv>CCZPPPPr<   c                     \        . RO. RO. RO.4      p\        V^ ^V R7      pVP                  ^8X  g   Q h\        P                  ! . RO. RO. RO.4      p\        VP                  P                  4       V4       R# )	r   r   N)r      r   r   r      r   r   r   r   rC   r   )r   rC   )r   rF   r   r4   r8   s   &   r   test_bottle_neck_graphrG   R   sc     y)Y78E
ua6
2C>>QHHiZ@AMsxx'')=9r<   c                 4   \        . RO. RO. RO. RO. RO. RO. RO. R	O.4      p\        V^ ^V R7      pVP                  ^8X  g   Q h\        P                  ! . RO. R
O. RO. RO. RO. RO. RO. RO.4      p\        VP                  P                  4       V4       R# )r   r   N)r   
   r   r   rI   r   r   r   )r   r   rI   r   r   r   r   r   )r   r   r   rI   r   r   r   r   )r   r   r   r   r   r   r   rI   )r   r   r   rI   r   rI   r   r   )r   r   r   r   r   r   rI   r   )r   r   r   r   r   r   r   r   )r   rI   r   r   r   r   r   )r   rJ   r   rI   r   r   r   r   )r   r   rJ   r   r   r   r   rI   )rJ   r   r   r   r   rI   r   r   )r   r   r   r   rJ   r   rI   r   )r   r   r   r   r   rJ   r   rI   )r   r   r   rJ   r   r   rJ   r   r4   r8   s   &   r   test_backwards_flowrK   ]   s     1000100/1 2E ua6
2C>>RHH8999999:< =M sxx'')=9r<   c           	         \        . RO. RO. RO. RO. RO. RO.4      p\        V^ ^V R7      pVP                  ^8X  g   Q h\        P                  ! . R	O. R
O. RO. RO. RO. RO.4      p\        VP                  P                  4       V4       R# )r   r   N)r         r   r   r   )r   r   rI      r   r   )r      r   r      r   )r   r   	   r   r      )r   r   r      r   rP   )r   r   r   r   r   r   )r   rO      r   r   r   )r   r   rO   r   r   )r   r   r   rU   r   )r   rV   r   r   i   )r   r   rW   rT   r   rP   )r   r   r   ir   r4   r8   s   &   r   #test_example_from_clrs_chapter_26_1rZ   x   s    
 ++**))+ ,E ua6
2C>>RHH2334235 6M sxx'')=9r<   c                    \        . RO. RO. RO. RO.4      p\        V^ ^V R7      pVP                  ^ 8X  g   Q h\        P                  ! R\        P
                  R7      p\        VP                  P                  4       V4       R# )r   r   r   N)r   rA   r   r   )r   r   r   r   )r   r   rR   rC   )rP   rP   )	r   r   r5   r   zerosint32r   r6   r7   r8   s   &   r   test_disconnected_graphr^      sm     |###% &E ua6
2C>>QHHV2884Msxx'')=9r<   c                    R p\         P                  ! ^V4      p\         P                  ! \        \	        V4      4      V^,
          .,           4      p\         P
                  ! V^,
          \         P                  R7      p\        WBV3W3R7      p\        V^ V^,
          V R7      pVP                  ^8X  g   Q hWUP                  4       ,
          p\        VP                  P                  VP                  4       \        VP                  P                  VP                  4       \        VP                  P                  VP                  4       R# )i r   )shaper   N)r   aranger   listrangeonesr]   r   r   r5   	transposer   r6   dataindicesindptr)r   nrg   rh   rf   r   r9   r:   s   &       r   "test_add_reverse_edges_large_graphrj      s     	Aii1oGXXd58nAw./F771q5)Dtf-aV<E
uaQv
6C>>QOO--Msxx}}m&8&89sxx'')>)>?sxx(<(<=r<   za,b_data_expectedc                    \        V \        P                  \        V 4      \        V 4      3R7      p \	        V 4      p\        VP                  V4       R# )zJTest that the reversal of the edges of the input graph works
as expected.
)r   r`   N)r   r   r]   lenr   r   rf   )ab_data_expectedbs   && r   test_add_reverse_edgesrp      s;     	!288CFCF+;<A1Aqvv/r<   z
a,expectedc                 h    \        V \        P                  R 7      p \        V 4      p\	        W!4       R# r   N)r   r   r]   r	   r   )rm   expectedrev_edge_ptrs   && r   test_make_edge_pointersru      s&     	!288$A&q)L|.r<   c                 h    \        V \        P                  R 7      p \        V 4      p\	        W!4       R# rr   )r   r   r]   r
   r   )rm   rs   tailss   && r   test_make_tailsrx      s%     	!288$ANEu'r<   )r%   rC   )r$   r   r%   rD   rE   )r$   r%   r   r   rC   )rR      rT   )rP   rA      )rR   rz   rT   rP   rA   r{   r   r   rB   )rP   rA   r   )r   rC   rP   r$   r%   )r   r   r$   r%   r%   )#numpyr   numpy.testingr   r   scipy.sparser   r   r   scipy.sparse.csgraphr   scipy.sparse.csgraph._flowr   r	   r
   methodsr   r   r"   r'   r)   markparametrizer-   r1   r;   r?   rG   rK   rZ   r^   rj   rp   ru   rx    r<   r   <module>r      s    ,  9 9 -  7
#999"9 7+:.6 / ,6 7+,4 - ,4 7+: ,: 7+Q ,Q 7+: ,: 7+: ,:4 7+: ,:* 7+
: ,
: 7+> ,> ,T2JcA3ZI&8I&(@A	/C D
0D
0 T2JcUBKcUQCL!fr1gAI&8( // T2JcUBKcUQCL!fr1gAI&8( ((r<   