@@ -2946,6 +2946,26 @@ def avg_nearest_neighbor_degree(graph: Graph, vids: VertexSelector = "all", mode
29462946 return knn , knnk
29472947
29482948
2949+ def degree_correlation_vector (graph : Graph , weights : Optional [Iterable [float ]] = None , from_mode : NeighborMode = NeighborMode .OUT , to_mode : NeighborMode = NeighborMode .IN , directed_neighbors : bool = True ) -> RealArray :
2950+ """Type-annotated wrapper for ``igraph_degree_correlation_vector``."""
2951+ # Prepare input arguments
2952+ c_graph = graph
2953+ c_knnk = _Vector .create (0 )
2954+ c_weights = edge_weights_to_igraph_vector_t_view (weights , graph )
2955+ c_from_mode = c_int (from_mode )
2956+ c_to_mode = c_int (to_mode )
2957+ c_directed_neighbors = any_to_igraph_bool_t (directed_neighbors )
2958+
2959+ # Call wrapped function
2960+ igraph_degree_correlation_vector (c_graph , c_knnk , c_weights , c_from_mode , c_to_mode , c_directed_neighbors )
2961+
2962+ # Prepare output arguments
2963+ knnk = igraph_vector_t_to_numpy_array (c_knnk )
2964+
2965+ # Construct return value
2966+ return knnk
2967+
2968+
29492969def strength (graph : Graph , vids : VertexSelector = "all" , mode : NeighborMode = NeighborMode .ALL , loops : bool = True , weights : Optional [Iterable [float ]] = None ) -> RealArray :
29502970 """Type-annotated wrapper for ``igraph_strength``."""
29512971 # Prepare input arguments
@@ -3179,6 +3199,25 @@ def assortativity_degree(graph: Graph, directed: bool = True) -> float:
31793199 return res
31803200
31813201
3202+ def joint_degree_matrix (graph : Graph , max_out_degree : int = - 1 , max_in_degree : int = - 1 , weights : Optional [Iterable [float ]] = None ) -> RealArray :
3203+ """Type-annotated wrapper for ``igraph_joint_degree_matrix``."""
3204+ # Prepare input arguments
3205+ c_graph = graph
3206+ c_jdm = _Matrix .create (0 )
3207+ c_max_out_degree = max_out_degree
3208+ c_max_in_degree = max_in_degree
3209+ c_weights = edge_weights_to_igraph_vector_t_view (weights , graph )
3210+
3211+ # Call wrapped function
3212+ igraph_joint_degree_matrix (c_graph , c_jdm , c_max_out_degree , c_max_in_degree , c_weights )
3213+
3214+ # Prepare output arguments
3215+ jdm = igraph_matrix_t_to_numpy_array (c_jdm )
3216+
3217+ # Construct return value
3218+ return jdm
3219+
3220+
31823221def contract_vertices (graph : Graph , mapping : Iterable [int ], vertex_attr_comb : Optional [AttributeCombinationSpecification ] = None ) -> None :
31833222 """Type-annotated wrapper for ``igraph_contract_vertices``."""
31843223 # Prepare input arguments
@@ -3244,6 +3283,24 @@ def graph_center(graph: Graph, mode: NeighborMode = NeighborMode.ALL) -> IntArra
32443283 return res
32453284
32463285
3286+ def graph_center_dijkstra (graph : Graph , weights : Optional [Iterable [float ]] = None , mode : NeighborMode = NeighborMode .ALL ) -> IntArray :
3287+ """Type-annotated wrapper for ``igraph_graph_center_dijkstra``."""
3288+ # Prepare input arguments
3289+ c_graph = graph
3290+ c_weights = edge_weights_to_igraph_vector_t_view (weights , graph )
3291+ c_res = _VectorInt .create (0 )
3292+ c_mode = c_int (mode )
3293+
3294+ # Call wrapped function
3295+ igraph_graph_center_dijkstra (c_graph , c_weights , c_res , c_mode )
3296+
3297+ # Prepare output arguments
3298+ res = igraph_vector_int_t_to_numpy_array (c_res )
3299+
3300+ # Construct return value
3301+ return res
3302+
3303+
32473304def radius (graph : Graph , mode : NeighborMode = NeighborMode .ALL ) -> float :
32483305 """Type-annotated wrapper for ``igraph_radius``."""
32493306 # Prepare input arguments
@@ -3261,6 +3318,24 @@ def radius(graph: Graph, mode: NeighborMode = NeighborMode.ALL) -> float:
32613318 return radius
32623319
32633320
3321+ def radius_dijkstra (graph : Graph , weights : Optional [Iterable [float ]] = None , mode : NeighborMode = NeighborMode .ALL ) -> float :
3322+ """Type-annotated wrapper for ``igraph_radius_dijkstra``."""
3323+ # Prepare input arguments
3324+ c_graph = graph
3325+ c_weights = edge_weights_to_igraph_vector_t_view (weights , graph )
3326+ c_radius = igraph_real_t ()
3327+ c_mode = c_int (mode )
3328+
3329+ # Call wrapped function
3330+ igraph_radius_dijkstra (c_graph , c_weights , c_radius , c_mode )
3331+
3332+ # Prepare output arguments
3333+ radius = c_radius .value
3334+
3335+ # Construct return value
3336+ return radius
3337+
3338+
32643339def pseudo_diameter (graph : Graph , start_vid : VertexLike , directed : bool = True , unconnected : bool = True ) -> tuple [float , int , int ]:
32653340 """Type-annotated wrapper for ``igraph_pseudo_diameter``."""
32663341 # Prepare input arguments
@@ -5776,59 +5851,38 @@ def gomory_hu_tree(graph: Graph, capacity: Optional[Iterable[float]] = None) ->
57765851# igraph_maxflow_value: no Python type known for type: MAXFLOW_STATS
57775852
57785853
5779- def mincut_value (graph : Graph , capacity : Optional [Iterable [float ]] = None ) -> float :
5780- """Type-annotated wrapper for ``igraph_mincut_value``."""
5781- # Prepare input arguments
5782- c_graph = graph
5783- c_res = igraph_real_t ()
5784- c_capacity = edge_capacities_to_igraph_vector_t_view (capacity , graph ) if capacity is not None else None
5785-
5786- # Call wrapped function
5787- igraph_mincut_value (c_graph , c_res , c_capacity )
5788-
5789- # Prepare output arguments
5790- res = c_res .value
5791-
5792- # Construct return value
5793- return res
5794-
5795-
5796- def st_mincut (graph : Graph , source : VertexLike , target : VertexLike , capacity : Optional [Iterable [float ]] = None ) -> tuple [float , IntArray , IntArray , IntArray ]:
5797- """Type-annotated wrapper for ``igraph_st_mincut``."""
5854+ def mincut (graph : Graph , capacity : Optional [Iterable [float ]] = None ) -> tuple [float , IntArray , IntArray , IntArray ]:
5855+ """Type-annotated wrapper for ``igraph_mincut``."""
57985856 # Prepare input arguments
57995857 c_graph = graph
58005858 c_value = igraph_real_t ()
5801- c_cut = _VectorInt .create (0 )
58025859 c_partition1 = _VectorInt .create (0 )
58035860 c_partition2 = _VectorInt .create (0 )
5804- c_source = vertexlike_to_igraph_integer_t (source )
5805- c_target = vertexlike_to_igraph_integer_t (target )
5861+ c_cut = _VectorInt .create (0 )
58065862 c_capacity = edge_capacities_to_igraph_vector_t_view (capacity , graph ) if capacity is not None else None
58075863
58085864 # Call wrapped function
5809- igraph_st_mincut (c_graph , c_value , c_cut , c_partition1 , c_partition2 , c_source , c_target , c_capacity )
5865+ igraph_mincut (c_graph , c_value , c_partition1 , c_partition2 , c_cut , c_capacity )
58105866
58115867 # Prepare output arguments
58125868 value = c_value .value
5813- cut = igraph_vector_int_t_to_numpy_array (c_cut )
58145869 partition1 = igraph_vector_int_t_to_numpy_array (c_partition1 )
58155870 partition2 = igraph_vector_int_t_to_numpy_array (c_partition2 )
5871+ cut = igraph_vector_int_t_to_numpy_array (c_cut )
58165872
58175873 # Construct return value
5818- return value , cut , partition1 , partition2
5874+ return value , partition1 , partition2 , cut
58195875
58205876
5821- def st_mincut_value (graph : Graph , source : VertexLike , target : VertexLike , capacity : Optional [Iterable [float ]] = None ) -> float :
5822- """Type-annotated wrapper for ``igraph_st_mincut_value ``."""
5877+ def mincut_value (graph : Graph , capacity : Optional [Iterable [float ]] = None ) -> float :
5878+ """Type-annotated wrapper for ``igraph_mincut_value ``."""
58235879 # Prepare input arguments
58245880 c_graph = graph
58255881 c_res = igraph_real_t ()
5826- c_source = vertexlike_to_igraph_integer_t (source )
5827- c_target = vertexlike_to_igraph_integer_t (target )
58285882 c_capacity = edge_capacities_to_igraph_vector_t_view (capacity , graph ) if capacity is not None else None
58295883
58305884 # Call wrapped function
5831- igraph_st_mincut_value (c_graph , c_res , c_source , c_target , c_capacity )
5885+ igraph_mincut_value (c_graph , c_res , c_capacity )
58325886
58335887 # Prepare output arguments
58345888 res = c_res .value
@@ -5837,29 +5891,6 @@ def st_mincut_value(graph: Graph, source: VertexLike, target: VertexLike, capaci
58375891 return res
58385892
58395893
5840- def mincut (graph : Graph , capacity : Optional [Iterable [float ]] = None ) -> tuple [float , IntArray , IntArray , IntArray ]:
5841- """Type-annotated wrapper for ``igraph_mincut``."""
5842- # Prepare input arguments
5843- c_graph = graph
5844- c_value = igraph_real_t ()
5845- c_partition1 = _VectorInt .create (0 )
5846- c_partition2 = _VectorInt .create (0 )
5847- c_cut = _VectorInt .create (0 )
5848- c_capacity = edge_capacities_to_igraph_vector_t_view (capacity , graph ) if capacity is not None else None
5849-
5850- # Call wrapped function
5851- igraph_mincut (c_graph , c_value , c_partition1 , c_partition2 , c_cut , c_capacity )
5852-
5853- # Prepare output arguments
5854- value = c_value .value
5855- partition1 = igraph_vector_int_t_to_numpy_array (c_partition1 )
5856- partition2 = igraph_vector_int_t_to_numpy_array (c_partition2 )
5857- cut = igraph_vector_int_t_to_numpy_array (c_cut )
5858-
5859- # Construct return value
5860- return value , partition1 , partition2 , cut
5861-
5862-
58635894def residual_graph (graph : Graph , capacity : Iterable [float ], flow : Iterable [float ]) -> tuple [Graph , RealArray ]:
58645895 """Type-annotated wrapper for ``igraph_residual_graph``."""
58655896 # Prepare input arguments
@@ -5897,6 +5928,50 @@ def reverse_residual_graph(graph: Graph, capacity: Iterable[float], flow: Iterab
58975928 # Construct return value
58985929 return residual
58995930
5931+
5932+ def st_mincut (graph : Graph , source : VertexLike , target : VertexLike , capacity : Optional [Iterable [float ]] = None ) -> tuple [float , IntArray , IntArray , IntArray ]:
5933+ """Type-annotated wrapper for ``igraph_st_mincut``."""
5934+ # Prepare input arguments
5935+ c_graph = graph
5936+ c_value = igraph_real_t ()
5937+ c_cut = _VectorInt .create (0 )
5938+ c_partition1 = _VectorInt .create (0 )
5939+ c_partition2 = _VectorInt .create (0 )
5940+ c_source = vertexlike_to_igraph_integer_t (source )
5941+ c_target = vertexlike_to_igraph_integer_t (target )
5942+ c_capacity = edge_capacities_to_igraph_vector_t_view (capacity , graph ) if capacity is not None else None
5943+
5944+ # Call wrapped function
5945+ igraph_st_mincut (c_graph , c_value , c_cut , c_partition1 , c_partition2 , c_source , c_target , c_capacity )
5946+
5947+ # Prepare output arguments
5948+ value = c_value .value
5949+ cut = igraph_vector_int_t_to_numpy_array (c_cut )
5950+ partition1 = igraph_vector_int_t_to_numpy_array (c_partition1 )
5951+ partition2 = igraph_vector_int_t_to_numpy_array (c_partition2 )
5952+
5953+ # Construct return value
5954+ return value , cut , partition1 , partition2
5955+
5956+
5957+ def st_mincut_value (graph : Graph , source : VertexLike , target : VertexLike , capacity : Optional [Iterable [float ]] = None ) -> float :
5958+ """Type-annotated wrapper for ``igraph_st_mincut_value``."""
5959+ # Prepare input arguments
5960+ c_graph = graph
5961+ c_res = igraph_real_t ()
5962+ c_source = vertexlike_to_igraph_integer_t (source )
5963+ c_target = vertexlike_to_igraph_integer_t (target )
5964+ c_capacity = edge_capacities_to_igraph_vector_t_view (capacity , graph ) if capacity is not None else None
5965+
5966+ # Call wrapped function
5967+ igraph_st_mincut_value (c_graph , c_res , c_source , c_target , c_capacity )
5968+
5969+ # Prepare output arguments
5970+ res = c_res .value
5971+
5972+ # Construct return value
5973+ return res
5974+
59005975# igraph_st_vertex_connectivity: no Python type known for type: VCONNNEI
59015976
59025977
@@ -6821,52 +6896,52 @@ def deterministic_optimal_imitation(graph: Graph, vid: VertexLike, quantities: I
68216896 strategies = igraph_vector_int_t_to_numpy_array (c_strategies )
68226897
68236898
6824- def stochastic_imitation (graph : Graph , vid : VertexLike , algo : ImitateAlgorithm , quantities : Iterable [float ], strategies : Iterable [int ], mode : NeighborMode = NeighborMode .OUT ) -> None :
6825- """Type-annotated wrapper for ``igraph_stochastic_imitation ``."""
6899+ def moran_process (graph : Graph , quantities : Iterable [float ], strategies : Iterable [int ], weights : Optional [ Iterable [ float ]] = None , mode : NeighborMode = NeighborMode .OUT ) -> None :
6900+ """Type-annotated wrapper for ``igraph_moran_process ``."""
68266901 # Prepare input arguments
68276902 c_graph = graph
6828- c_vid = vertexlike_to_igraph_integer_t (vid )
6829- c_algo = c_int (algo )
6830- c_quantities = vertex_qtys_to_igraph_vector_t_view (quantities , graph )
6903+ c_weights = edge_weights_to_igraph_vector_t_view (weights , graph )
6904+ c_quantities = vertex_qtys_to_igraph_vector_t (quantities , graph )
68316905 c_strategies = iterable_to_igraph_vector_int_t (strategies )
68326906 c_mode = c_int (mode )
68336907
68346908 # Call wrapped function
6835- igraph_stochastic_imitation (c_graph , c_vid , c_algo , c_quantities , c_strategies , c_mode )
6909+ igraph_moran_process (c_graph , c_weights , c_quantities , c_strategies , c_mode )
68366910
68376911 # Prepare output arguments
6912+ quantities = igraph_vector_t_to_numpy_array (c_quantities )
68386913 strategies = igraph_vector_int_t_to_numpy_array (c_strategies )
68396914
68406915
6841- def moran_process (graph : Graph , quantities : Iterable [ float ], strategies : Iterable [ int ], weights : Optional [ Iterable [float ]] = None , mode : NeighborMode = NeighborMode .OUT ) -> None :
6842- """Type-annotated wrapper for ``igraph_moran_process ``."""
6916+ def roulette_wheel_imitation (graph : Graph , vid : VertexLike , is_local : bool , quantities : Iterable [float ], strategies : Iterable [ int ] , mode : NeighborMode = NeighborMode .OUT ) -> None :
6917+ """Type-annotated wrapper for ``igraph_roulette_wheel_imitation ``."""
68436918 # Prepare input arguments
68446919 c_graph = graph
6845- c_weights = edge_weights_to_igraph_vector_t_view (weights , graph )
6846- c_quantities = vertex_qtys_to_igraph_vector_t (quantities , graph )
6920+ c_vid = vertexlike_to_igraph_integer_t (vid )
6921+ c_is_local = any_to_igraph_bool_t (is_local )
6922+ c_quantities = vertex_qtys_to_igraph_vector_t_view (quantities , graph )
68476923 c_strategies = iterable_to_igraph_vector_int_t (strategies )
68486924 c_mode = c_int (mode )
68496925
68506926 # Call wrapped function
6851- igraph_moran_process (c_graph , c_weights , c_quantities , c_strategies , c_mode )
6927+ igraph_roulette_wheel_imitation (c_graph , c_vid , c_is_local , c_quantities , c_strategies , c_mode )
68526928
68536929 # Prepare output arguments
6854- quantities = igraph_vector_t_to_numpy_array (c_quantities )
68556930 strategies = igraph_vector_int_t_to_numpy_array (c_strategies )
68566931
68576932
6858- def roulette_wheel_imitation (graph : Graph , vid : VertexLike , is_local : bool , quantities : Iterable [float ], strategies : Iterable [int ], mode : NeighborMode = NeighborMode .OUT ) -> None :
6859- """Type-annotated wrapper for ``igraph_roulette_wheel_imitation ``."""
6933+ def stochastic_imitation (graph : Graph , vid : VertexLike , algo : ImitateAlgorithm , quantities : Iterable [float ], strategies : Iterable [int ], mode : NeighborMode = NeighborMode .OUT ) -> None :
6934+ """Type-annotated wrapper for ``igraph_stochastic_imitation ``."""
68606935 # Prepare input arguments
68616936 c_graph = graph
68626937 c_vid = vertexlike_to_igraph_integer_t (vid )
6863- c_is_local = any_to_igraph_bool_t ( is_local )
6938+ c_algo = c_int ( algo )
68646939 c_quantities = vertex_qtys_to_igraph_vector_t_view (quantities , graph )
68656940 c_strategies = iterable_to_igraph_vector_int_t (strategies )
68666941 c_mode = c_int (mode )
68676942
68686943 # Call wrapped function
6869- igraph_roulette_wheel_imitation (c_graph , c_vid , c_is_local , c_quantities , c_strategies , c_mode )
6944+ igraph_stochastic_imitation (c_graph , c_vid , c_algo , c_quantities , c_strategies , c_mode )
68706945
68716946 # Prepare output arguments
68726947 strategies = igraph_vector_int_t_to_numpy_array (c_strategies )
0 commit comments