igraph 0.10.0
This release focuses on infrastructural improvements, stability, and making the igraph interface more consistent, more predictable and easier to use. It contains many API-breaking changes and function renamings, in preparation for a future 1.0 release, at which point the API will become stable. Changes in this direction are likely to continue through a 0.11 release. It is recommended that you migrate your code from 0.9 to 0.10 soon, to make the eventual transition to 1.0 easier.
Some of the highlights are:
- A consistent use of
igraph_integer_tfor all indices and most integer quantities, both in the API and internally. This type is 64-bit by default on all 64-bit systems, bringing support for very large graphs with more than 2 billion vertices. Previously, vertex and edge indices were often represented asigraph_real_t. The move to anigraph_integer_talso implies a change fromigraph_vector_ttoigraph_vector_int_tin many functions. - The random number generation framework has been overhauled. Sampling from the full range of
igraph_integer_tis now possible. Similarly, the sampling of random reals has been improved to utilize almost the full range of the mantissa of anigraph_real_t. - There is a new fully memory-managed container type for lists of vectors (
igraph_vector_list_t), replacing most previous uses of the non-managedigraph_vector_ptr_t. Functions that previously usedigraph_vector_ptr_tto return results and relied on the user to manage memory appropriately are now usingigraph_vector_list_t,igraph_graph_list_tor similar and manage memory on their own. - Some simple graph properties, such as whether a graph contains self-loops or multi-edges, or whether it is connected, are now cached in the graph data structure. Querying these properties for a second time will take constant computational time. The
igraph_invalidate_cache()function is provided for debugging purposes. It will invaidate all cache entries. - File format readers are much more robust and more tolerant of invalid input.
- igraph is much more resilient to overflow errors.
- Many improvements to robustness and reliability, made possible by internal refactorings.
Breaking changes
- igraph now requires CMake 3.18 or later.
- In order to facilitate the usage of graphs with more than 2 billion vertices and edges, we have made the size of the
igraph_integer_tdata type to be 32 bits on 32-bit platforms and 64 bits on 64-bit platforms by default. You also have the option to compile a 32-bit igraph variant on a 64-bit platform by changing theIGRAPH_INTEGER_SIZEbuild variable in CMake to 32. igraph_bool_tis now a C99booland not anint. Similarly,igraph_vector_bool_tnow consumessizeof(bool)bytes per entry only, notsizeof(int). The standard constantstrueandfalsemay be used for Boolean values for readability.- The random number generator interface,
igraph_rng_type_t, has been overhauled. Check the declaration of the type for details. - The default random number generator has been changed from Mersenne Twister to PCG32.
- Functions related to spectral coarse graining (i.e. all functions starting with
igraph_scg_...) were separated into a project of its own. If you wish to keep on using these functions, please refer to the repository hosting the spectral coarse graining code at https://github.com/igraph/igraph-scg . The spectral coarse graining code was updated to support igraph 0.10. - Since
igraph_integer_taims to be the largest integer size that is feasible on a particular platform, there is no need for generic data types based onlong intany more. Thelongvariants of generic data types (e.g.,igraph_vector_long_t) are therefore removed; you should use the correspondingintvariant instead, whose elements are of typeigraph_integer_t. - Generic data types based on
floatwere removed as they were not used anywhere in the library. - Several igraph functions that used to take a
long intor return along intnow takes or returns anigraph_integer_tinstead to make the APIs more consistent. Similarly, igraph functions that usedigraph_vector_tfor arguments that take or return integral vectors (e.g., vertex or edge indices) now takeigraph_vector_int_tinstead. Graph-related functions where the API was changed due to this reason are listed below, one by one. - Similarly, igraph functions that used to accept the
longvariant of a generic igraph data type (e.g.,igraph_vector_long_t) now take theintvariant of the same data type. - The type
igraph_stack_ptr_tand its associated functions were removed. Useigraph_vector_ptr_tand associated functions instead. - Error handlers should no longer perform a
longjmp(). Doing so will introduce memory leaks, as resource cleanup is now done in multiple stages, through multiple calls to the error handler. Thus, the error handler should either abort execution immediately (as the default handler does), or report the error, callIGRAPH_FINALLY_FREE(), and return normally. - Most callback functions now return an error code. In previous versions they returned a boolean value indicating whether to terminate the search. A request to stop the search is now indicated with the special return code
IGRAPH_STOP. igraph_add_edges()now uses anigraph_vector_int_tfor itsedgesparameter.igraph_adjacency()no longer accepts a negative number of edges in its adjacency matrix. When negative entries are found, an error is generated.igraph_adjacency()gained an additionalloopsargument that lets you specify whether the diagonal entries should be ignored or should be interpreted as raw edge counts or twice the number of edges (which is common in linear algebra contexts).igraph_all_minimal_st_separators()now returns the separators in anigraph_vector_int_list_tcontainingigraph_vector_int_tvectors.igraph_all_st_cuts()andigraph_all_st_mincuts()now return the cuts in anigraph_vector_int_list_tcontainingigraph_vector_int_tvectors.igraph_arpack_unpack_complex()now usesigraph_integer_tfor itsnevargument instead oflong int.igraph_articulation_points()now uses anigraph_vector_int_tto return the list of articulation points, not anigraph_vector_t.igraph_assortativity_nominal()now accepts vertex types in anigraph_vector_int_tinstead of anigraph_vector_t.igraph_asymmetric_preferennce_game()now uses anigraph_vector_int_tto return the types of the nodes in the generated graph.igraph_atlas()now usesigraph_integer_tfor itsnumberargument.igraph_automorphism_group()now returns the generators in anigraph_vector_int_list_tinstead of a pointer vector containingigraph_vector_tobjects.igraph_barabasi_game(),igraph_barabasi_aging_game(),igraph_recent_degree_game()andigraph_recent_degree_aging_game()now use anigraph_vector_int_tfor the out-degree sequence of the nodes being generated instead of anigraph_vector_t.igraph_bfs()now takes anigraph_vector_int_tfor itsroots,restricted,order,father,pred,succanddistarguments instead of anigraph_vector_t.igraph_bfs_simple()now takesigraph_vector_int_tfor itsvids,layersandparentsarguments instead of anigraph_vector_t.igraph_bfs_simple()now returns -1 inparentsfor the root node of the traversal, and -2 for unreachable vertices. This is now consistent with other functions that return a parent vector.igraph_biconnected_components()now uses anigraph_vector_int_tto return the list of articulation points, not anigraph_vector_t. Also, the container used for the edges and vertices of the components is now anigraph_vector_int_list_tinstead of a pointer vector containingigraph_vector_tobjects.igraph_bipartite_projection()now usesigraph_vector_int_tto returnmultiplicity1andmultiplicity2, notigraph_vector_t.igraph_bridges()now uses anigraph_vector_int_tto return the list of bridges, not anigraph_vector_t.igraph_callaway_traits_game()returns the node types in anigraph_vector_int_tinstead of anigraph_vector_t.igraph_canonical_permutation()now uses anigraph_vector_int_tfor its labeling parameter.igraph_cattribute_list()now usesigraph_vector_int_tto returngtypes,vtypesandetypes.igraph_cited_type_game()now uses anigraph_vector_int_tfor its types parameter.igraph_citing_cited_type_game()now uses anigraph_vector_int_tfor its
types parameter.igraph_clique_handler_tnow uses anigraph_vector_int_tfor itscliqueparameter, and must return anigraph_error_t. UseIGRAPH_STOPas the return code to terminate the search prematurely. The vector that the handler receives is owned by the clique search routine. If you want to hold on to the vector for a longer period of time, you need to make a copy of it in the handler. Cliques passed to the callback are marked asconstas a reminder to this change.- The
resparameter ofigraph_cliques()is now anigraph_vector_int_list_t. - Callbacks used by
igraph_cliques_callback()need to be updated to account for the fact that the callback does not own the clique passed to it any more; the callback needs to make a copy if it wants to hold on to the clique for a longer period of time. If the callback does not need to store the clique, it does not need to do anything any more, and it must not destroy or free the clique. igraph_closeness()andigraph_closeness_cutoff()now use anigraph_vector_int_tto returnreachable_count, not anigraph_vector_t.igraph_cohesive_blocks()now uses anigraph_vector_int_tto return the mapping from block indices to parent block indices, and thecohesion; also, it uses anigraph_vector_int_list_tto return the blocks themselves instead of a pointer vector ofigraph_vector_t.- The
igraph_community_eb_get_merges()bridges parameter now starts the indices into the edge removal vector at 0, not 1. - The
igraph_community_eb_get_merges()now reports an error when not all edges in the graph are removed, instead of a nonsensical result. igraph_community_edge_betweenness()now uses anigraph_vector_int_tto return the edge IDs in the order of their removal as well as the list of edge IDs whose removal broke a single component into two.igraph_community_fluid_communities()does not provide the modularity in a separate output argument any more; useigraph_modularity()to retrieve the modularity if you need it.igraph_community_infomap()now usesigraph_integer_tfor itsnb_trialsargument.igraph_community_label_propagation()now uses anigraph_vector_int_tfor itsinitialparameter. It also takes amodeargument that specifies how labels should be propagated along edges (forward, backward or ignoring edge directions).igraph_community_label_propagation()does not provide the modularity in a separate output argument any more; useigraph_modularity()to retrieve the modularity if you need it.igraph_community_leiden()has an additional parameter to indicate the number of iterations to perform (PR #2177).igraph_community_walktrap(),igraph_community_edge_betweenness(),igraph_community_eb_get_merges(),igraph_community_fastgreedy(),igraph_community_to_membership(),igraph_le_community_to_membership(),igraph_community_leading_eigenvector()now use anigraph_vector_int_tfor theirmergesparameter.igraph_community_walktrap()now usesigraph_integer_tfor itsstepsargument.igraph_coreness()now uses anigraph_vector_int_tto return the coreness
values.igraph_convex_hull()now uses anigraph_vector_int_tto return the indices of the input vertices that were chosen to be in the convex hull.igraph_correlated_game()andigraph_correlated_pair_game()now take anigraph_vector_int_tas the permutation vector, not anigraph_vector_t.igraph_create()now uses anigraph_vector_int_tfor itsedgesparameter.igraph_create_bipartite()now uses anigraph_vector_int_tfor itsedgesparameter.igraph_compose()now returns the edge maps in anigraph_vector_int_tinstead of anigraph_vector_t.igraph_count_multiple()now returns the multiplicities in anigraph_vector_int_tinstead of anigraph_vector_t.igraph_decompose()now uses anigraph_integer_tfor itsmaxcompnoandminelementsarguments instead of along int.igraph_degree()now uses anigraph_vector_int_tto return the degrees. If you need the degrees in a vector containing floating-point numbers instead (e.g., because you want to pass them on to some other function that takes anigraph_vector_t), useigraph_strength()instead with a null weight vector.igraph_degree_sequence_game()now takes degree sequences represented asigraph_vector_int_tinstead ofigraph_vector_t.igraph_degseq_t, used byigraph_degree_sequence_game(), uses new names for its constants. The old names are deprecated, but retained for compatibility. Seeigraph_constants.hto see which new name corresponds to which old one.igraph_delete_vertices_idx()now usesigraph_vector_int_tvectors to return the mapping and the inverse mapping of old vertex IDs to new ones.igraph_deterministic_optimal_imitation()now expects the list of strategies in anigraph_vector_int_tinstead of anigraph_int_t.igraph_dfs()now takes anigraph_vector_int_tfor itsorder,order_out,fatheranddistarguments instead of anigraph_vector_t. Furthermore, these vectors will contain -2 for vertices that have not been visited; in earlier versions, they used to contain NaN instead. Note that -1 is still used in thefathervector to indicate the root of a DFS tree.igraph_diameter()andigraph_diameter_dijkstra()now useigraph_vector_int_tvectors to return the list of vertex and edge IDs in the diameter.igraph_dominator_tree()now takes anigraph_vector_int_tfor itsdomandleftoutarguments instead of anigraph_vector_t.igraph_dyad_census()now usesigraph_real_tinstead ofigraph_integer_tfor its output arguments, and it no longer returns -1 when overflow occurs.igraph_edges()now takes anigraph_vector_int_tfor itsedgesargument instead of anigraph_vector_t.igraph_es_multipairs()was removed; you can use the newly addedigraph_es_all_between()instead.igraph_establishment_game()now takes anigraph_vector_int_tfor itsnode_type_vecargument instead of anigraph_vector_t.igraph_eulerian_path()andigraph_eulerian_cycle()now useigraph_vector_int_tto return the list of edge and vertex IDs participating in an Eulerian path or cycle instead of anigraph_vector_t.igraph_feedback_arc_set()now uses anigraph_vector_int_tto return the IDs of the edges in the feedback arc set instead of anigraph_vector_t.igraph_get_adjacency()no longer has theeidsargument, which would produce an adjacency matrix where non-zero values were 1-based (not 0-based) edge IDs. If you need a matrix with edge IDs, create it manually.igraph_get_adjacency_sparse()now returns the sparse adjacency matrix in anigraph_sparsemat_tstructure, and it assumes that the input matrix is initialized for sake of consistency with other igraph functions.igraph_get_adjacency()andigraph_get_adjacency_sparse()now has aloopsargument that lets the user specify how loop edges should be handled.igraph_get_edgelist()now uses anigraph_vector_int_tfor itsresparameter.igraph_get_eids()now usesigraph_vector_int_tto return lists of edge IDs and to receive lists of vertex IDs.- The
pathargument ofigraph_get_eids()was removed. You can replicate the old behaviour by constructing the list of vertex IDs explicitly from the path by duplicating each vertex in the path except the first and last ones. A helper function calledigraph_expand_path_to_pairs()is provided to ease the transition. igraph_get_eids_multi()was removed as its design was fundamentally broken; there was no way to retrieve the IDs of all edges between a specific pair of vertices without knowing in advance how many such edges there are in the graph. Useigraph_get_all_eids_between()instead.igraph_get_incidence()now returns the vertex IDs corresponding to the rows and columns of the incidence matrix asigraph_vector_int_t.igraph_get_shortest_path(),igraph_get_shortest_path_bellman_ford()andigraph_get_shortest_path_dijkstra()now useigraph_vector_int_tvectors to return the list of vertex and edge IDs in the shortest path.igraph_get_shortest_paths(),igraph_get_shortest_paths_dijkstra()andigraph_get_shortest_paths_bellman_ford()now use anigraph_vector_int_tto return the predecessors and inbound edges instead of anigraph_vector_long_t.- The functions
igraph_get_all_shortest_paths(),igraph_get_all_shortest_paths_dijkstra(),igraph_get_shortest_paths(),igraph_get_shortest_paths_bellman_ford()andigraph_get_shortest_paths_dijkstra()now return paths in anigraph_vector_int_list_tinstead of a pointer vector containingigraph_vector_tobjects. - The vector of parents in
igraph_get_shortest_paths(),igraph_get_shortest_paths_bellman_ford()andigraph_get_shortest_paths_dijkstra()now use -1 to represent the starting vertex, and -2 for unreachable vertices. - The
mapsparameters inigraph_get_isomorphisms_vf2()andigraph_get_subisomorphisms_vf2()are now of typeigraph_vector_int_list_t. igraph_get_stochastic()now has an additionalweightsargument for edge weights.igraph_get_stochastic_sparse()now returns the sparse adjacency matrix in anigraph_sparsemat_tstructure, and it assumes that the input matrix is initialized for sake of consistency with other igraph functions. It also received an additionalweightsargument for edge weights.igraph_girth()now uses anigraph_vector_int_tfor itscircleparameter.igraph_girth()now usesigraph_real_tas the return value so we can return infinity for graphs with no cycles (instead of zero).- The
cliquesparameters of typeigraph_vector_ptr_tinigraph_graphlets(),igraph_graphlets_candidate_basis()andigraph_graphlets_project()were changed to anigraph_vector_int_list_t. igraph_hrg_init()andigraph_hrg_resize()now takes anigraph_integer_tas their size arguments instead of anint.igraph_hrg_consensus()now returns the parent vector in anigraph_vector_int_tinstead of anigraph_vector_t.igraph_hrg_create()now takes a vector of probabilities corresponding to the internal nodes of the dendogram. It used to also take probabilities for the leaf nodes and then ignore them.igraph_hrg_predict()now uses anigraph_vector_int_tfor itsedgesparameter.igraph_hrg_sample()now always samples a single graph only. Useigraph_hrg_sample_many()if you need more than one sample, and calligraph_hrg_fit()beforehand if you do not have a HRG model but only a single input graph.igraph_hrg_size()now returns anigraph_integer_tinstead of anint.igraph_incidence()does not accept negative incidence counts any more.igraph_incident()now uses anigraph_vector_int_tfor itseidsparameter.- The
resparameter inigraph_independent_vertex_sets()is now anigraph_vector_int_list_t. igraph_induced_subgraph_map()now usesigraph_vector_int_tvectors to return the mapping and the inverse mapping of old vertex IDs to new ones.igraph_intersection()now uses anigraph_vector_int_tfor itsedge_map1andedge_map2parameters.- The
edgemapsparameter ofigraph_intersection_many()is now anigraph_vector_int_list_tinstead of a pointer vector. igraph_is_chordal()now uses anigraph_vector_int_tfor itsalpha,alpham1andfill_inparameters.igraph_is_graphical()andigraph_is_bigraphical()now take degree sequences represented asigraph_vector_int_tinstead ofigraph_vector_t.igraph_is_matching(),igraph_is_maximal_matching()andigraph_maximum_bipartite_matchingnow use anigraph_vector_int_tto return the matching instead of anigraph_vector_long_t.igraph_is_mutual()has an additional parameter which controls whether directed self-loops are considered mutual.- The
vidsparameter forigraph_isoclass_subgraph()is now anigraph_vector_int_tinstead ofigraph_vector_t. igraph_isomorphic_vf2(),igraph_get_isomorphisms_vf2_callback()(which used to be calledigraph_isomorphic_function_vf2()) andigraph_isohandler_tnow all useigraph_vector_int_tfor theirmap12andmap21parameters.- The
cliquesparameter of typeigraph_vector_ptr_tinigraph_largest_cliques()was changed to anigraph_vector_int_list_t. - The
resparameters of typeigraph_vector_ptr_tinigraph_largest_independent_vertex_sets()andigraph_largest_weighted_cliques()were changed to anigraph_vector_int_list_t. - The dimension vector parameter for
igraph_square_lattice()(used to beigraph_lattice()) is now anigraph_vector_int_tinstead ofigraph_vector_t. - The maxiter parameter of
igraph_layout_bipartite()is now anigraph_integer_tinstead oflong int. - The fixed parameter of
igraph_layout_drl()andigraph_layout_drl_3d()was removed as it has never been implemented properly. - The width parameter of
igraph_layout_grid()is now anigraph_integer_tinstead oflong int. - The width and height parameters of
igraph_layout_grid_3d()are nowigraph_integer_tinstead oflong int. - The dimension parameter of
igraph_layout_mds()is now anigraph_integer_tinstead oflong int. - The
rootsandrootlevelparameters ofigraph_layout_reingold_tilford()are nowigraph_vector_int_tinstead ofigraph_vector_t. - The
rootsandrootlevelparameters ofigraph_layout_reingold_tilford_circular()are nowigraph_vector_int_tinstead ofigraph_vector_t. - The order parameter of
igraph_layout_star()is now anigraph_vector_int_tinstead of anigraph_vector_t. - The maxiter parameter of
igraph_layout_sugiyama()is now anigraph_integer_tinstead oflong int. Also, the function now uses anigraph_vector_int_tfor itsextd_to_orig_eidsparameter. - The shifts parameter of
igraph_lcf_vector()is now anigraph_vector_int_tinstead of anigraph_vector_t. igraph_matrix_minmax(),igraph_matrix_which_minmax(),igraph_matrix_which_min()andigraph_matrix_which_max()no longer return an error code. The return type is nowvoid. These functions never fail.igraph_maxflow()now uses anigraph_vector_int_tfor itscut,partitionandpartition2parameters.- The
igraph_maxflow_stats_tstruct now containsigraph_integer_tvalues instead ofintones. - The
resparameters inigraph_maximal_cliques()andigraph_maximal_cliques_subset()are now of typeigraph_vector_int_list_t. - Callbacks used by
igraph_maximal_cliques_callback()need to be updated to account for the fact that the callback does not own the clique passed to it any more; the callback needs to make a copy if it wants to hold on to the clique for a longer period of time. If the callback does not need to store the clique, it does not need to do anything any more, and it must not destroy or free the clique. - The
resparameter inigraph_maximal_independent_vertex_sets()is now anigraph_vector_int_list_t. igraph_maximum_cardinality_search()now uses anigraph_vector_int_tfor itsalphaandalpham1arguments.igraph_mincut()now uses anigraph_vector_int_tfor itscut,partitionandpartition2parameters.igraph_moran_process()now expects the list of strategies in anigraph_vector_int_tinstead of anigraph_int_t.- Motif callbacks of type
igraph_motifs_handler_tnow take anigraph_vector_int_twith the vertex IDs instead of anigraph_vector_t, and useigraph_integer_tfor the isoclass parameter. - Motif functions now use
igraph_integer_tinstead ofintfor theirsizeparameter. igraph_neighborhood_size()now uses anigraph_vector_int_tfor itsresparameter.- The
resparameter ofigraph_neighborhood()is now anigraph_vector_int_list_t. igraph_neighbors()now uses anigraph_vector_int_tfor itsneisparameter.igraph_permute_vertices()now takes anigraph_vector_int_tas the permutation vector.igraph_power_law_fit()does not calculate the p-value automatically any more because the previous estimation method did not match the results from the original paper of Clauset, Shalizi and Newman (2009) and the implementation of the method outlined in the paper runs slower than the previous naive estimate. A separate function namedigraph_plfit_result_calculate_p_value()is now provided for calculating the p-value. The automatic selection of thex_mincutoff also uses a different method than earlier versions. As a consequence, results might be slightly different if you used tests where thex_mincutoff was selected automatically. The new behaviour is now consistent with the defaults of the underlyingplfitlibrary.igraph_preference_game()now uses anigraph_vector_int_tto return the types of the nodes in the generated graph.igraph_random_walk()now uses anigraph_vector_int_tfor its results. Also, the function now takes both vertices and edges as parameters. It can return IDs of vertices and/or edges on the walk. The function now takes weights as a parameter to support weighted graphs.igraph_random_edge_walk()now uses anigraph_vector_int_tfor itsedgewalkparameter.igraph_read_graph_dimacs_flow()now uses anigraph_vector_int_tfor its label parameter.igraph_read_graph_graphml()now usesigraph_integer_tfor itsindexargument.igraph_read_graph_pajek()now creates a Booleantypeattribute for bipartite graphs. Previously it created a numeric attribute.igraph_realize_degree_sequence()now uses anigraph_vector_int_tfor itsoutdegandindegparameters.igraph_reindex_membership()now uses anigraph_vector_int_tfor itsnew_to_oldparameter.igraph_rng_seed()now requires anigraph_uint_tas its seed arguments. RNG implementations are free to use only the lower bits of the seed if they do not support 64-bit seeds.igraph_rngtype_rand(i.e. the RNG that is based on BSDrand()) was removed due to poor statistical properties that sometimes resulted in weird artifacts like all-even "random" numbers when igraph's usage patterns happened to line up with the shortcomings of therand()generator in a certain way.igraph_roulette_wheel_imitation()now expects the list of strategies in anigraph_vector_int_tinstead of anigraph_int_t.igraph_similarity_dice_pairs()now uses anigraph_vector_int_tfor itspairsparameter.igraph_similarity_jaccard_pairs()now uses anigraph_vector_int_tfor itspairsparameter.igraph_simple_interconnected_islands_game()does not generate multi-edges between islands any more.igraph_sort_vertex_ids_by_degree()andigraph_topological_sorting()now use anigraph_vector_int_tto return the vertex IDs instead of anigraph_vector_t.igraph_spanning_tree(),igraph_minimum_spanning_tree()andigraph_random_spanning_tree()now all use anigraph_vector_int_tto return the vector of edge IDs in the spanning tree instead of anigraph_vector_t.igraph_sparsemat_cholsol(),igraph_sparsemat_lusol(),igraph_sparsemat_symbqr()andigraph_sparsemat_symblu()now take anigraph_integer_tas theirorderparameter.igraph_sparsemat_count_nonzero()andigraph_sparsemat_count_nonzerotol()now return anigraph_integer_t.igraph_sparsemat_is_symmetric()now returns an error code and the result itself is provided in an output argument.- The
valuesargument ofigraph_sparsemat_transpose()was removed; now the function always copies the values over to the transposed matrix. igraph_spmatrix_tand related functions were removed as they mostly duplicated functionality that was already present inigraph_sparsemat_t. Functions that usedigraph_spmatrix_tin the library now useigraph_sparsemat_t.igraph_stochastic_imitation()now expects the list of strategies in anigraph_vector_int_tinstead of anigraph_int_t.igraph_st_mincut()now uses anigraph_vector_int_tfor itscut,partitionandpartition2parameters.igraph_st_vertex_connectivity()now ignores edges between source and target forIGRAPH_VCONN_NEI_IGNOREigraph_strvector_get()now returns strings in the return value, not in an output argument.igraph_subcomponent()now uses anigraph_integer_tfor the seed vertex instead of anigraph_real_t. It also uses anigraph_vector_int_tto return the list of vertices in the same component as the seed vertex instead of anigraph_vector_t.igraph_subisomorphic_vf2(),igraph_get_subisomorphisms_vf2_callback()(which used to be calledigraph_subisomorphic_function_vf2()) andigraph_isomorphic_bliss()now all useigraph_vector_int_tfor theirmap12andmap21parameters.- The
mapsparameters inigraph_subisomorphic_lad(),igraph_get_isomorphisms_vf2()andigraph_get_subisomorphisms_vf2()are now of typeigraph_vector_int_list_t. igraph_subisomorphic_lad()now uses anigraph_vector_int_tfor itsmapparameter. Also, itsdomainsparameter is now anigraph_vector_int_list_tinstead of a pointer vector containingigraph_vector_tobjects.igraph_unfold_tree()now uses anigraph_vector_int_tfor itsvertex_indexandrootsparameters.igraph_union()now uses anigraph_vector_int_tfor itsedge_map1andedge_map2parameters.- The
edgemapsparameter ofigraph_union_many()is now anigraph_vector_int_list_tinstead of a pointer vector. igraph_vector_init_copy()was refactored to take another vector that the newly initialized vector should copy. The old array-based initialization function is now calledigraph_vector_init_array().igraph_vector_ptr_init_copy()was renamed toigraph_vector_ptr_init_array()for sake of consistency.igraph_vs_vector(),igraph_vss_vector()andigraph_vs_vector_copy()now all take anigraph_vector_int_tas the vector of vertex IDs, not anigraph_vector_t. Similarly,igraph_vs_as_vector()now returns the vector of matched vertex IDs in anigraph_vector_int_t, not anigraph_vector_t.- The
resparameter ofigraph_weighted_cliques()is now anigraph_vector_int_list_t. igraph_write_graph_dimacs_flow()now usesigraph_integer_tfor the source and target vertex index instead of along int.igraph_vector_*(),igraph_matrix_*(),igraph_stack_*(),igraph_array_*()and several other generic igraph data types now useigraph_integer_tfor indexing, notlong int. Please refer to the headers for the exact details; the list of affected functions is too large to include here.igraph_vector_minmax()andigraph_vector_which_minmax()no longer return an error code. The return type is nowvoid. These functions never fail.igraph_vector_order()was removed; useigraph_vector_int_pair_order()instead. (The original function worked for vectors containing integers only).igraph_vector_resize_min()andigraph_matrix_resize_min()no longer return an error code (return type is nowvoid). The vector or matrix is always left in a consistent state by these functions, with all data intact, even if releasing unused storage is not successful.igraph_vector_qsort_ind()and its variants now take anigraph_order_tenum instead of a boolean to denote whether the order should be ascending or descending.igraph_weighted_adjacency()now returns the weights in a separate vector instead of storing it in a vertex attribute. The reason is twofold: first, the previous solution worked only with the C attribute handler (not the ones from the higher-level interfaces), and second, it wasn't consistent with other igraph functions that use weights provided as separate arguments.- The
loopsargument ofigraph_weighted_adjacency()was converted to anigraph_loops_tfor sake of consistency withigraph_adjacency()andigraph_get_adjacency(). igraph_write_graph_gml()takes an additional bitfield parameter controlling some aspects of writing the GML file.- The
add_edges()function in the attribute handler now takes anigraph_vector_int_tfor itsedgesparameter instead of anigraph_vector_t. Theadd_vertices()function now takes anigraph_integer_tfor the vertex count instead of along int. Thecombine_vertices()andcombine_edges()functions now take anigraph_vector_ptr_tcontaining vectors of typeigraph_vector_int_tin theirmergesparameters. Theget_info()function now usesigraph_vector_int_tto return the types of the graph, vertex and edge attribute types. Thepermute_vertices()andpermute_edges()functions in the attribute handler tables now take anigraph_vector_int_tinstead of anigraph_vector_tfor the index vectors. These are relevant only to maintainers of higher level interfaces to igraph; they should update their attribute handlers accordingly. - igraph functions that interface with external libraries such as BLAS or LAPACK may now fail if the underlying BLAS or LAPACK implementation cannot handle the size of input vectors or matrices (BLAS and LAPACK are usually limited to vectors whose size fits in an
int).igraph_blas_dgemv()andigraph_blas_dgemv_array()thus now return anigraph_error_t, which may be set toIGRAPH_EOVERFLOWif the input vectors or matrices are too large. - Functions that used an
igraph_vector_tto represent cluster size and cluster membership now use anigraph_vector_int_tinstead. These are:igraph_connected_components()(used to beigraph_clusters()in 0.9 and before)igraph_community_eb_get_merges()igraph_community_edge_betweenness()igraph_community_fastgreedy()igraph_community_fluid_communities()igraph_community_infomap()igraph_community_label_propagation()igraph_community_leading_eigenvector()igraph_community_leiden()igraph_community_multilevel()igraph_community_optimal_modularity()igraph_community_spinglass()igraph_community_spinglass_single()igraph_community_to_membership()igraph_community_walktrap()igraph_compare_communities()igraph_le_community_to_membership()igraph_modularity()igraph_reindex_membership()igraph_split_join_distance()igraph_community_multilevel()additionally uses aigraph_matrix_int_tinstead ofigraph_matrix_t()for its memberships parameter.
IGRAPH_TOTALwas removed from theigraph_neimode_tenum; use the equivalentIGRAPH_ALLinstead.
Added
- A new integer type,
igraph_uint_thas been added. This is the unsigned pair ofigraph_integer_tand they are always consistent in size. - A new container type,
igraph_vector_list_thas been added, replacing most uses ofigraph_vector_ptr_tin the API where it was used to hold a variable-length list of vectors. The type containsigraph_vector_tobjects, and it is fully memory managed (i.e. its contents do not need to be allocated and destroyed manually). There is also a variant namedigraph_vector_int_list_tfor vectors ofigraph_vector_int_tobjects. - A new container type,
igraph_matrix_list_thas been added, replacing most uses ofigraph_vector_ptr_tin the API where it was used to hold a variable-length list of matrices. The type containsigraph_matrix_tobjects, and it is fully memory managed (i.e. its contents do not need to be allocated and destroyed manually). - A new container type,
igraph_graph_list_thas been added, replacing most uses ofigraph_vector_ptr_tin the API where it was used to hold a variable-length list of graphs. The type containsigraph_tobjects, and it is fully memory managed (i.e. its contents do not need to be allocated and destroyed manually). - The vector container type,
igraph_vector_t, has been extended with a new variant whose functions all start withigraph_vector_fortran_int_.... This vector container can be used for interfacing with Fortran code as it guarantees that the integers in the vector are compatible with Fortran integers. Note thatigraph_vector_int_tis not suitable any more, as the elements ofigraph_vector_int_tare of typeigraph_integer_t, whose size may differ on 32-bit and 64-bit platforms, depending on how igraph was compiled. igraph_adjlist_init_from_inclist()to create an adjacency list from an already existing incidence list by resolving edge IDs to their corresponding endpoints. This function is useful for algorithms when both an adjacency and an incidence list is needed and they should be in the same order.igraph_almost_equals()andigraph_cmp_epsilon()to compare floating point numbers with a relative tolerance.igraph_betweenness_subset()andigraph_edge_betweenness_subset()calculates betweenness and edge betweenness scores using shortest paths between a subset of vertices only (#1711, thanks to @guyroznb)igraph_blas_dgemm()to multiply two matrices.igraph_calloc()andigraph_realloc()are now publicly exposed; these functions provide variants ofcalloc()andrealloc()that can safely be deallocated within igraph functions.igraph_circulant()to create circulant graphs (#1856, thanks to @Gomango999).igraph_complex_almost_equals()to compare complex numbers with a relative tolerance.igraph_eccentricity_dijkstra()finds the longest weighted path length among all shortest paths between a set of vertices.igraph_enter_safelocale()andigraph_exit_safelocale()for temporarily setting the locale to C. Foreign format readers and writers require a locale which uses a decimal point instead of decimal comma.igraph_es_all_between()to create an edge selector that selects all edges between a pair of vertices.igraph_full_multipartite()generates full multipartite graphs (a generalization of bipartite graphs to multiple groups).igraph_fundamental_cycles()computes a fundamental cycle basis (experimental).igraph_generalized_petersen()to create generalized Petersen graphs (#1844, thanks to @alexsyou).igraph_get_all_eids_between()returns the IDs of all edges between a pair of vertices.igraph_get_k_shortest_paths()finds the k shortest paths between a source and a target vertex.igraph_get_laplacian()andigraph_get_laplacian_sparse()return the Laplacian matrix of the graph as a dense or sparse matrix, with various kinds of normalizations. They replace the now-deprecatedigraph_laplacian()function. This makes the API consistent withigraph_get_adjacency()andigraph_get_adjacency_sparse().igraph_get_widest_path(),igraph_get_widest_paths(),igraph_widest_path_widths_dijkstra()andigraph_widest_path_widths_floyd_warshall()to find widest paths (#1893, thanks to @Gomango999).igraph_graph_center()finds the central vertices of the graph. The central vertices are the ones having a minimum eccentricity (PR #2084, thanks to @pradkrish).igraph_graph_count()returns the number of unlabelled graphs on a given number of vertices. It is meant to find the maximum isoclass value.igraph_has_mutual()checks if a directed graph has any mutual edges.igraph_heap_clear()andigraph_heap_min_clear()remove all elements from anigraph_heap_tor anigraph_heap_min_t, respectively.igraph_invalidate_cache()invalidates all cached graph properties, forcing their recomputation next time they are requested. This function should not be needed in everyday usage, but may be useful in debugging and benchmarking.igraph_is_forest()to check whether a graph is a forest (#1888, thanks to @rohitt28).igraph_is_acyclic()to check whether a graph is acyclic (#1945, thanks to @borsgeorgica).igraph_is_perfect()to check whether a graph is a perfect graph (#1730, thanks to @guyroznb).igraph_hub_and_authority_scores()calculates the hub and authority scores of a graph as a matching pair.igraph_layout_umap()andigraph_layout_umap_3d()to lay out a graph in 2D or 3D space using the UMAP dimensionality reduction algorithm.igraph_local_scan_subset_ecount()counts the number of edges in induced sugraphs from a subset of vertices.igraph_matrix_view_from_vector()allows interpreting the data stored in a vector as a matrix of the specified size.igraph_minimum_cycle_basis()computes an unweighted minimum cycle basis (experimental).igraph_pseudo_diameter()andigraph_pseudo_diameter_dijkstra()to determine a lower bound for the diameter of a graph (unweighted or weighted).igraph_regular_tree()creates a regular tree where all internal vertices have the same total degree.igraph_rngtype_pcg32andigraph_rngtype_pcg64implement 32-bit and 64-bit variants of the PCG random number generator.igraph_rng_get_pois()generates random variates from the Poisson distribution.igraph_roots_for_tree_layout()computes a set of roots suitable for a nice tree layout.igraph_spanner()calculates a spanner of a graph with a given stretch factor (#1752, thanks to @guyroznb)igraph_sparse_adjacency()andigraph_sparse_weighted_adjacency()constructs graphs from (weighted) sparse matrices.igraph_sparsemat_get()to retrieve a single element of a sparse matrix.igraph_sparsemat_normalize_rows()andigraph_sparsemat_normalize_cols()to normalize sparse matrices row-wise or column-wise.igraph_stack_capacity()to query the capacity of a stack.igraph_strvector_capacity()returns the maximum number of strings that can be stored in a string vector without reallocating the memory block holding the pointers to the individual strings.igraph_strvector_merge()moves all strings from one string vectors to the end of another without re-allocating them.igraph_strvector_push_back_len()adds a new string to the end of a string vector and allows the user to specify the length of the string being added.igraph_strvector_reserve()reserves space for a given number of string pointers in a string vector.igraph_symmetric_tree()to create a tree with the specified number of branches at each level (#1859, thanks to @YuliYudith and @DoruntinaM).igraph_trussness()calculates the trussness of each edge in the graph (#1034, thanks to @alexperrone)igraph_turan()generates Turán graphs (#2088, thanks to @pradkrish)igraph_vector_all_almost_e(),igraph_vector_complex_all_almost_e(),igraph_matrix_all_almost_e(),igraph_matrix_complex_all_almost_e()for elementwise comparisons of floating point vector and matrices with a relative tolerance.igraph_vector_complex_zapsmall()andigraph_matrix_complex_zapsmall()for replacing small components of complex vector or matrix elements with exact zeros.igraph_vector_lex_cmp_untyped()andigraph_vector_colex_cmp_untyped()for lexicographic and colexicographic comparison of vectors, similarly toigraph_vector_lex_cmp()andigraph_vector_colex_cmp(). The difference between the two variants is that the untyped versions declare the vectors asconst void*, making the functions suitable as comparators forqsort().igraph_vector_permute()functions to permute a vector based on an index vector.igraph_vector_ptr_sort_ind()to obtain an index vector that would sort a vector of pointers based on some comparison function.igraph_vector_range()to fill an existing vector with a range of increasing numbers.igraph_vector_remove_fast()functions to remove an item from a vector by swapping it with the last element and then popping it off. It allows one to remove an item from a vector in constant time if the order of items does not matter.igraph_vertex_path_from_edge_path()converts a sequence of edge IDs representing a path to an equivalent sequence of vertex IDs that represent the vertices the path travelled through.igraph_vs_range(),igraph_vss_range(),igraph_es_range()andigraph_ess_range()creates vertex and edge sequences from C-style intervals (closed from the left, open from the right).igraph_wheel()to create a wheel graph (#1938, thanks to @kwofach).
Removed
igraph_adjlist_remove_duplicate(),igraph_betweenness_estimate(),igraph_closeness_estimate(),igraph_edge_betweenness_estimate(),igraph_inclist_remove_duplicate(),igraph_is_degree_sequence()andigraph_is_graphical_degree_sequence()were deprecated earlier in 0.9.0 and are now removed in this release.igraph_dnorm(),igraph_strvector_move_interval(),igraph_strvector_permdelete()andigraph_strvector_remove_negidx()were removed. These are not breaking changes as the functions were never documented, they were only exposed from one of the headers.igraph_eigen_laplacian(),igraph_es_fromto()andigraph_maximum_matching()were removed. These are not breaking changes either as the functions were never implemented, they returned an error code unconditionally.
Changed
igraph_degree_sequence_game()now supports an additional method,IGRAPH_DEGSEQ_EDGE_SWITCHING_SIMPLE, an edge-switching MCMC sampler.igraph_get_adjacency()andigraph_get_adjacency_sparse()now count loop edges twice in undirected graphs when usingIGRAPH_GET_ADJACENCY_BOTH. This is to ensure consistency withIGRAPH_GET_ADJACENCY_UPPERandIGRAPH_GET_ADJACENCY_LOWERsuch that the sum of the upper and the lower triangle matrix is equal to the full adjacency matrix even in the presence of loop edges.igraph_matrix_print()andigraph_matrix_fprint()functions now align columns when priting.igraph_read_graph_gml()now supports graph attributes (in addition to vertex and edge attributes).igraph_read_graph_gml()now uses NaN as the default numerical attribute values instead of 0.- The Pajek parser in
igraph_read_graph_pajek()is now less strict and accepts more files. igraph_ring()no longer simplifies its result when generating a one- or two-vertex graph. The one-cycle has a self-loop and the undirected two-cycle has parallel edges.igraph_vector_view()now allowsdatato beNULLin the special case whenlength == 0.igraph_version()no longer returns an error code.igraph_write_graph_gml()uses thecreatorparameter in a different way: the supplied string is now written into the Creator line as-is instead of being appended to a default value.igraph_write_graph_gml()skips writing NaN values. These two changes ensure consistent round-tripping.igraph_write_graph_gml()andigraph_read_graph_gml()now have limited support for entity encoding.igraph_write_graph_ncol()now preserves the edge ordering of the graph when writing an NCOL file.- igraph functions that take an ARPACK options object now also accept
NULLin place of an options object, and they will fall back to using a default object provided byigraph_arpack_options_get_default(). - Foreign format readers now present more informative error messages.
- The default tolerance of the zapsmall functions is now
eps^(2/3)instead ofeps^(1/2)where eps is the machine epsilon ofigraph_real_t. - It is now possible to override the uniform integer and the Poisson samplers in the random number generator interface.
Fixed
- When an error occurs during parsing DL, GML, NCOL, LGL or Pajek files, line numbers are now reported correctly.
- The GraphML parser does not print to stderr any more in case of encoding errors and other error conditions originating from the underlying
libxml2library. - The GraphML parser would omit some edges and vertices when reading files with custom attribute types, such as those produced by yEd. This is now corrected.
- The GML parser no longer mixes up Inf and NaN and -Inf now works.
- The GML parser now supports nodes with no id field.
- The GML parser now performs more stringent checks on the input file, such as verifying that
id,source,targetanddirectedfields are not duplicated. - The core data structures (vector, etc.) have overflow checks now.
- Deterministic graph generators, as well as most random ones, have overflow checks now.
- Graphs no longer lose all their attributes after calling
igraph_contract_vertices(). igraph_hrg_init()does not throw an assertion error anymore for zero vertices.igraph_matrix_complex_create()andigraph_matrix_complex_create_polar()now set their sizes correctly.igraph_random_walk()took one fewer steps than specified.igraph_sparsemat_getelements_sorted()did not sort the elements for triplet matrices correctly; this is fixed now.igraph_write_graph_gml()no longer produces corrupt output when some string attribute values contain"characters.
Deprecated
igraph_clusters()has been renamed toigraph_connected_components(); the old name is deprecated and will be removed in 0.11.igraph_complex_eq_tol()is now deprecated in favour ofigraph_complex_almost_equals().igraph_get_sparsemat()is deprecated in favour ofigraph_get_adjacency_sparse(), and will be removed in 0.11. Note thatigraph_get_adjacency_sparse()takes an initialized sparse matrix as input, unlikeigraph_get_sparsemat()which takes an uninitialized one.igraph_get_stochastic_sparsemat()is deprecated in favour ofigraph_get_stochastic_sparse(), and will be removed in 0.11. Note thatigraph_get_stochastic_sparse()takes an initialized sparse matrix as input, unlikeigraph_get_stochastic_sparsemat(), which takes an uninitialized one.igraph_isomorphic_34()has been deprecated in favour ofigraph_isomorphic(). Note thatigraph_isomorphic()calls an optimized version for directed graphs of size 3 and 4, and undirected graphs with 3-6 vertices, so there is no need for a separate function.igraph_laplacian()is now deprecated; useigraph_get_laplacian()origraph_get_laplacian_sparse()depending on whether you need a dense or a sparse matrix.igraph_lattice()has been renamed toigraph_square_lattice()to indicate that this function generates square lattices only. The old name is deprecated and will either be removed in 0.11 or will be changed to become a generic lattice generator that also supports other types of lattices.igraph_local_scan_neighborhood_ecount()is now deprecated in favour ofigraph_local_scan_subset_ecount().igraph_matrix_all_e_tol()is now deprecated in favour ofigraph_matrix_all_almost_e().igraph_matrix_copy()is now deprecated; useigraph_matrix_init_copy()instead. The new name emphasizes that the function initializes the first argument instead of expecting an already-initialized target matrix. The old name will be removed in 0.11.igraph_matrix_e()andigraph_matrix_e_ptr()have been renamed toigraph_matrix_get()andigraph_matrix_get_ptr(). The old names are deprecated and will be removed in 0.11.igraph_random_edge_walk()has been deprecated byigraph_random_walk()to support edges and/or vertices for the random walk in a single function. It will be removed in 0.11.igraph_read_graph_dimacs()has been renamed toigraph_read_graph_dimacs_flow(); the old name is deprecated and might be re-used as a generic DIMACS reader in the future. Also, the function now usesigraph_integer_tas the source and target vertex IDs instead of along int.igraph_shortest_paths()and related functions were renamed toigraph_distances(); the old name was unfortunate because these functions calculated path lengths only and not the paths themselves. The old names are deprecated and will be removed in 0.11.igraph_sparsemat_copy(),igraph_sparsemat_diag()andigraph_sparsemat_eye()have been renamed toigraph_sparsemat_init_copy(),igraph_sparsemat_init_diag()andigraph_sparsemat_init_eye()to indicate that they initialize a new sparse matrix. The old names are deprecated and will be removed in 0.11.igraph_strvector_add()has been renamed toigraph_strvector_push_back()for sake of consistency with other vector-like data structures; the old name is deprecated and will be removed in 0.11.igraph_strvector_copy()has been renamed toigraph_strvector_init_copy()for sake of consistency with other vector-like data structures; the old name is deprecated and will be removed in 0.11.igraph_strvector_get()now returns aconst char*and not achar*to indicate that you are not supposed to modify the string in the vector directly. If you do want to modify it and you are aware of the implications (i.e. the new string must not be longer than the original one), you can cast away the constness of the return value before modifying it.igraph_strvector_set2()has been renamed toigraph_strvector_set_len(); the old name is deprecated and will be removed in 0.11.igraph_tree()has been renamed toigraph_kary_tree(); the old name is deprecated and will be removed in 0.11.igraph_vector_e()andigraph_vector_e_ptr()have been renamed toigraph_vector_get()andigraph_vector_get_ptr(). The old names are deprecated and will be removed in 0.11.igraph_vector_e_tol()is now deprecated in favour ofigraph_vector_all_almost_e().igraph_vector_copy()is now deprecated; useigraph_vector_init_copy()instead. The new name emphasizes that the function initializes the first argument instead of expecting an already-initialized target vector. The old name will be removed in 0.11.igraph_vector_init_seq()is now deprecated in favour ofigraph_vector_init_range(), which uses C-style intervals (closed from the left and open from the right).igraph_vs_seq(),igraph_vss_seq(),igraph_es_seq()andigraph_ess_seq()are now deprecated in favour ofigraph_vs_range(),igraph_vss_range(),igraph_es_range()andigraph_ess_range()because these use C-style intervals (closed from the left, open from the right).igraph_write_graph_dimacs()has been renamed toigraph_write_graph_dimacs_flow(); the old name is deprecated and might be re-used as a generic DIMACS writer in the future. Also, the function now usesigraph_integer_tas the source and target vertex IDs instead of along int.igraph_zeroin()is deprecated and will be removed in 0.11, with no replacement. The function is not graph-related and was never part of the public API.- The macros
igraph_Calloc,igraph_Reallocandigraph_Freehave been deprecated in favour ofIGRAPH_CALLOC,IGRAPH_REALLOCandIGRAPH_FREEto simplify the API. The deprecated variants will be removed in 0.11.
Other
- Documentation improvements.
- Support for Intel's LLVM-based compiler.