Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions src/vendor/cigraph/.devcontainer/devcontainer.json

This file was deleted.

7 changes: 6 additions & 1 deletion src/vendor/cigraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
### Changes

- `igraph_community_walktrap()` no longer requires `modularity` and `merges` to be non-NULL when `membership` is non-NULL.
- `igraph_isomorphic()` now supports multigraphs.
- Shortest path related functions now consistently ignore edges with positive infinite weights.

### Fixed

Expand All @@ -16,24 +18,27 @@
- HRG functions now require a graph with at least 3 vertices; previous versions crashed with smaller graphs.
- `igraph_arpack_rssolve()` and `igraph_arpack_rnsolve()`, i.e. the ARPACK interface in igraph, are now interruptible. As a result, several other functions that rely on ARPACK (eigenvector centrality, hub and authority scores, etc.) also became interruptible.
- `igraph_get_shortest_paths_dijkstra()`, `igraph_get_all_shortest_paths_dijkstra()` and `igraph_get_shortest_paths_bellman_ford()` now validate the `from` vertex.
- Fixed bugs in `igraph_local_scan_1_ecount()` for weighted undirected graphs which would miscount loops and multi-edges.

### Deprecated

- `igraph_automorphisms()` is now deprecated; its new name is `igraph_count_automorphisms()`. The old name is kept available until at least igraph 0.11.
- `igraph_hub_score()` and `igraph_authority_score()` are now deprecated. Use `igraph_hub_and_authority_scores()` instead.
- `igraph_get_incidence()` is now deprecated; its new name is `igraph_get_biadjacency()` to reflect that the returned matrix is an _adjacency_ matrix between pairs of vertices and not an _incidence_ matrix between vertices and edges. The new name is kept available until at least igraph 0.11. We plan to re-use the name in later versions to provide a proper incidence matrix where the rows are vertices and the columns are edges.
- `igraph_hrg_dendrogram()` is deprecated because it requires an attribute handler and it goes against the convention of returning attributes in vectors where possible. Use `igraph_from_hrg_dendrogram()` instead, which constructs the dendrogram as an igraph graph _and_ returns the associated probabilities in a vector.

### Other

- Improved performance for `igraph_vertex_connectivity()`.
- `igraph_simplify()` makes use of the cache, and avoids simplification when the graph is already known to be simple.
- Documentation improvements.

## [0.10.4] - 2023-01-26

### Added

- `igraph_get_shortest_path_astar()` finds a shortest path with the A* algorithm.
- `igraph_vertex_coloring_greedy()` now supports the DSatur heuristics (#2284, thanks to @professorcode1).
- `igraph_vertex_coloring_greedy()` now supports the DSatur heuristics through `IGRAPH_COLORING_GREEDY_DSATUR` (#2284, thanks to @professorcode1).

### Changed

Expand Down
1 change: 1 addition & 0 deletions src/vendor/cigraph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# * CROSSCOMPILING_EMULATOR can be a semicolon-separated list to pass arguments (3.15)
# * SKIP_REGULAR_EXPRESSION to handle skipped tests properly (3.16)
# * CheckLinkerFlag for HAVE_NEW_DTAGS test (3.18)
# * cmake -E cat (3.18)
cmake_minimum_required(VERSION 3.18...3.25)

# Add etc/cmake to CMake's search path so we can put our private stuff there
Expand Down
6 changes: 3 additions & 3 deletions src/vendor/cigraph/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,21 @@ jobs:
extra_cmake_args: '-DBLA_VENDOR=OpenBLAS'
build_shared: true

- job: linux_clang_15
- job: linux_clang_17
pool:
vmImage: 'ubuntu-22.04'
steps:
- script: |
sudo apt-get install ninja-build ccache -y
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 15
sudo ./llvm.sh 17
displayName: Install dependencies

- template: .azure/build.yml
parameters:
build_type: Debug
extra_cmake_args: '-DUSE_SANITIZER=Address\;Undefined -DCMAKE_C_FLAGS="-Og -fno-sanitize-recover=undefined -fno-sanitize=float-divide-by-zero" -DCMAKE_CXX_FLAGS="-Og -fno-sanitize-recover=undefined -fno-sanitize=float-divide-by-zero" -DCMAKE_C_COMPILER=clang-15 -DCMAKE_CXX_COMPILER=clang++-15'
extra_cmake_args: '-DUSE_SANITIZER=Address\;Undefined -DCMAKE_C_FLAGS="-Og -fno-sanitize-recover=undefined -fno-sanitize=float-divide-by-zero" -DCMAKE_CXX_FLAGS="-Og -fno-sanitize-recover=undefined -fno-sanitize=float-divide-by-zero" -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17'

- job: linux_x87
steps:
Expand Down
5 changes: 3 additions & 2 deletions src/vendor/cigraph/include/igraph_coloring.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ __BEGIN_DECLS
* \enumval IGRAPH_COLORING_GREEDY_DSATUR
* Choose the vertex with largest number of unique colors in its neighborhood, i.e. its
* "saturation degree". When multiple vertices have the same saturation degree, choose
* the one with the most not yet colored neighbors. This heuristic is known as "DSatur",
* and was introduced in Daniel Brélaz: New methods to color the vertices of a graph,
* the one with the most not yet colored neighbors. Added in igraph 0.10.4. This heuristic
* is known as "DSatur", and was proposed in
* Daniel Brélaz: New methods to color the vertices of a graph,
* Commun. ACM 22, 4 (1979), 251–256. https://doi.org/10.1145/359094.359101
*/
typedef enum {
Expand Down
8 changes: 5 additions & 3 deletions src/vendor/cigraph/include/igraph_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,8 @@ IGRAPH_EXPORT int IGRAPH_FINALLY_STACK_SIZE(void);
*
* \param expr An expression, usually a call to a user-defined callback function.
* It is guaranteed to be evaluated only once.
* \param code Pointer to an optional variable of type \c igraph_error_t; the
* value of this variable will be set to the error code if it is not a null
* \param code Pointer to an optional variable of type <type>igraph_error_t</type>;
* the value of this variable will be set to the error code if it is not a null
* pointer.
*/
#define IGRAPH_CHECK_CALLBACK(expr, code) \
Expand Down Expand Up @@ -852,6 +852,7 @@ typedef void igraph_warning_handler_t (const char *reason, const char *file, int
* \brief Installs a warning handler.
*
* Install the supplied warning handler function.
*
* \param new_handler The new warning handler function to install.
* Supply a null pointer here to uninstall the current
* warning handler, without installing a new one.
Expand Down Expand Up @@ -976,7 +977,7 @@ IGRAPH_EXPORT void igraph_warningf(const char *reason, const char *file, int lin
*
* \param reason Textual description of the error.
* \param file The source file in which the error is noticed.
* \param line The number of the line in the source file which triggered the error
* \param line The number of the line in the source file which triggered the error.
*/

typedef void igraph_fatal_handler_t (const char *reason, const char *file, int line);
Expand Down Expand Up @@ -1046,6 +1047,7 @@ IGRAPH_EXPORT IGRAPH_FUNCATTR_NORETURN void igraph_fatalf(const char *reason, co
* \a igraph functions can use this macro when a fatal error occurs and
* want to pass on extra information to the user about what went wrong.
* It calls \ref igraph_fatalf() with the proper parameters.
*
* \param reason Textual description of the error, a template string
* with the same syntax as the standard printf C library function.
* \param ... The additional arguments to be substituted into the
Expand Down
10 changes: 7 additions & 3 deletions src/vendor/cigraph/include/igraph_games.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ IGRAPH_EXPORT igraph_error_t igraph_barabasi_game(igraph_t *graph, igraph_intege
igraph_bool_t directed,
igraph_barabasi_algorithm_t algo,
const igraph_t *start_from);
IGRAPH_EXPORT igraph_error_t igraph_erdos_renyi_game(igraph_t *graph, igraph_erdos_renyi_t type,
igraph_integer_t n, igraph_real_t p_or_m,
igraph_bool_t directed, igraph_bool_t loops);
IGRAPH_EXPORT igraph_error_t igraph_erdos_renyi_game_gnp(igraph_t *graph, igraph_integer_t n, igraph_real_t p,
igraph_bool_t directed, igraph_bool_t loops);
IGRAPH_EXPORT igraph_error_t igraph_erdos_renyi_game_gnm(igraph_t *graph, igraph_integer_t n, igraph_integer_t m,
Expand Down Expand Up @@ -220,6 +217,13 @@ IGRAPH_EXPORT igraph_error_t igraph_sample_sphere_volume(igraph_integer_t dim, i
IGRAPH_EXPORT igraph_error_t igraph_sample_dirichlet(igraph_integer_t n, const igraph_vector_t *alpha,
igraph_matrix_t *res);

/* Deprecated functions: */

IGRAPH_EXPORT IGRAPH_DEPRECATED igraph_error_t igraph_erdos_renyi_game(
igraph_t *graph, igraph_erdos_renyi_t type, igraph_integer_t n,
igraph_real_t p_or_m, igraph_bool_t directed, igraph_bool_t loops
);

__END_DECLS

#endif
11 changes: 9 additions & 2 deletions src/vendor/cigraph/include/igraph_hrg.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ IGRAPH_EXPORT igraph_error_t igraph_hrg_game(
igraph_t *graph, const igraph_hrg_t *hrg
);

IGRAPH_EXPORT igraph_error_t igraph_hrg_dendrogram(igraph_t *graph,
const igraph_hrg_t *hrg);
IGRAPH_EXPORT igraph_error_t igraph_from_hrg_dendrogram(
igraph_t *graph, const igraph_hrg_t *hrg, igraph_vector_t *prob
);

IGRAPH_EXPORT igraph_error_t igraph_hrg_consensus(const igraph_t *graph,
igraph_vector_int_t *parents,
Expand All @@ -120,6 +121,12 @@ IGRAPH_EXPORT igraph_error_t igraph_hrg_create(igraph_hrg_t *hrg,
const igraph_t *graph,
const igraph_vector_t *prob);

/* Deprecated functions: */

IGRAPH_DEPRECATED IGRAPH_EXPORT igraph_error_t igraph_hrg_dendrogram(
igraph_t *graph, const igraph_hrg_t *hrg
);

__END_DECLS

#endif /* IGRAPH_HRG_H */
11 changes: 3 additions & 8 deletions src/vendor/cigraph/interfaces/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,6 @@ igraph_barabasi_game:
BOOLEAN directed=True, BARABASI_ALGORITHM algo=BAG,
OPTIONAL GRAPH start_from

igraph_erdos_renyi_game:
PARAMS: |-
OUT GRAPH graph, ERDOS_RENYI_TYPE type, INTEGER n, REAL p_or_m,
BOOLEAN directed=False, BOOLEAN loops=False

igraph_erdos_renyi_game_gnp:
PARAMS: OUT GRAPH graph, INTEGER n, REAL p, BOOLEAN directed=False, BOOLEAN loops=False

Expand Down Expand Up @@ -1711,9 +1706,6 @@ igraph_hrg_sample_many:
igraph_hrg_game:
PARAMS: OUT GRAPH graph, HRG hrg

igraph_hrg_dendrogram:
PARAMS: OUT GRAPH graph, HRG hrg

igraph_hrg_consensus:
PARAMS: |-
GRAPH graph, OUT VECTOR_INT parents, OUT VECTOR weights,
Expand All @@ -1738,6 +1730,9 @@ igraph_hrg_size:
PARAMS: HRG hrg
RETURN: INTEGER

igraph_from_hrg_dendrogram:
PARAMS: OUT GRAPH graph, HRG hrg, OUT VECTOR prob

#######################################
# Conversion
#######################################
Expand Down
16 changes: 8 additions & 8 deletions src/vendor/cigraph/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -373,31 +373,31 @@ if(MATH_LIBRARY)
endif()

if(ARPACK_LIBRARIES)
target_link_libraries(igraph PUBLIC ${ARPACK_LIBRARIES})
target_link_libraries(igraph PRIVATE ${ARPACK_LIBRARIES})
endif()

if(BLAS_LIBRARIES)
target_link_libraries(igraph PUBLIC ${BLAS_LIBRARIES})
if(BLAS_FOUND)
target_link_libraries(igraph PRIVATE ${BLAS_LIBRARIES})
endif()

if(GLPK_LIBRARIES)
target_link_libraries(igraph PUBLIC ${GLPK_LIBRARIES})
target_link_libraries(igraph PRIVATE ${GLPK_LIBRARIES})
endif()

if(GMP_LIBRARIES)
target_link_libraries(igraph PUBLIC ${GMP_LIBRARIES})
target_link_libraries(igraph PRIVATE ${GMP_LIBRARIES})
endif()

if(LAPACK_LIBRARIES)
target_link_libraries(igraph PUBLIC ${LAPACK_LIBRARIES})
target_link_libraries(igraph PRIVATE ${LAPACK_LIBRARIES})
endif()

if(LIBXML2_LIBRARIES)
target_link_libraries(igraph PUBLIC ${LIBXML2_LIBRARIES})
target_link_libraries(igraph PRIVATE ${LIBXML2_LIBRARIES})
endif()

if(PLFIT_LIBRARIES)
target_link_libraries(igraph PUBLIC ${PLFIT_LIBRARIES})
target_link_libraries(igraph PRIVATE ${PLFIT_LIBRARIES})
endif()

# Link igraph statically to some of the libraries from the subdirectories
Expand Down
12 changes: 0 additions & 12 deletions src/vendor/cigraph/src/community/leading_eigenvector.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,23 +410,18 @@ igraph_error_t igraph_community_leading_eigenvector(
igraph_vector_list_clear(eigenvectors);
}

IGRAPH_STATUS("Starting leading eigenvector method.\n", 0);

if (!start) {
/* Calculate the weakly connected components in the graph and use them as
* an initial split */
IGRAPH_CHECK(igraph_connected_components(graph, mymembership, &idx, 0, IGRAPH_WEAK));
communities = igraph_vector_int_size(&idx);
IGRAPH_STATUSF(("Starting from %" IGRAPH_PRId " component(s).\n", 0, communities));
if (history) {
IGRAPH_CHECK(igraph_vector_push_back(history,
IGRAPH_LEVC_HIST_START_FULL));
}
} else {
/* Just create the idx vector for the given membership vector */
communities = igraph_vector_int_max(mymembership) + 1;
IGRAPH_STATUSF(("Starting from given membership vector with %" IGRAPH_PRId
" communities.\n", 0, communities));
if (history) {
IGRAPH_CHECK(igraph_vector_push_back(history,
IGRAPH_LEVC_HIST_START_GIVEN));
Expand Down Expand Up @@ -512,7 +507,6 @@ igraph_error_t igraph_community_leading_eigenvector(
/* depth first search */
igraph_integer_t size = 0;

IGRAPH_STATUSF(("Trying to split community %" IGRAPH_PRId "... ", 0, comm));
IGRAPH_ALLOW_INTERRUPTION();

for (i = 0; i < no_of_nodes; i++) {
Expand Down Expand Up @@ -631,7 +625,6 @@ igraph_error_t igraph_community_leading_eigenvector(
}

if (storage.d[0] <= 0) {
IGRAPH_STATUS("no split.\n", 0);
if (history) {
IGRAPH_CHECK(igraph_vector_push_back(history,
IGRAPH_LEVC_HIST_FAILED));
Expand All @@ -651,7 +644,6 @@ igraph_error_t igraph_community_leading_eigenvector(
}
}
if (l == 0 || l == size) {
IGRAPH_STATUS("no split.\n", 0);
if (history) {
IGRAPH_CHECK(igraph_vector_push_back(history,
IGRAPH_LEVC_HIST_FAILED));
Expand All @@ -667,7 +659,6 @@ igraph_error_t igraph_community_leading_eigenvector(
mod += storage.v[size + i] * storage.v[i];
}
if (mod <= 1e-8) {
IGRAPH_STATUS("no modularity increase, no split.\n", 0);
if (history) {
IGRAPH_CHECK(igraph_vector_push_back(history,
IGRAPH_LEVC_HIST_FAILED));
Expand All @@ -677,7 +668,6 @@ igraph_error_t igraph_community_leading_eigenvector(
}

communities++;
IGRAPH_STATUS("split.\n", 0);

/* Rewrite the mymembership vector */
for (j = 0; j < size; j++) {
Expand Down Expand Up @@ -720,8 +710,6 @@ igraph_error_t igraph_community_leading_eigenvector(
igraph_vector_int_destroy(&idx2);
IGRAPH_FINALLY_CLEAN(3);

IGRAPH_STATUS("Done.\n", 0);

/* reform the mymerges vector */
if (merges) {
igraph_vector_int_null(&idx);
Expand Down
4 changes: 2 additions & 2 deletions src/vendor/cigraph/src/community/louvain.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ static igraph_error_t igraph_i_community_multilevel_step(
new_id = old_id;

/* Update old community */
igraph_vector_int_set(communities.membership, ni, -1);
VECTOR(*communities.membership)[ni] = -1;
communities.item[old_id].size--;
if (communities.item[old_id].size == 0) {
communities.communities_no--;
Expand Down Expand Up @@ -447,7 +447,7 @@ static igraph_error_t igraph_i_community_multilevel_step(
/* debug("Added vertex %ld to community %ld (gain %lf).\n", ni, new_id, (double) max_q_gain); */

/* Add vertex to "new" community and update it */
igraph_vector_int_set(communities.membership, ni, new_id);
VECTOR(*communities.membership)[ni] = new_id;
if (communities.item[new_id].size == 0) {
communities.communities_no++;
}
Expand Down
2 changes: 1 addition & 1 deletion src/vendor/cigraph/src/community/modularity.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
* It does not have to be consecutive, i.e. empty communities
* are allowed.
* \param weights Weight vector or \c NULL if no weights are specified.
* \param resolution The resolutin parameter \c γ. Must not be negative.
* \param resolution The resolution parameter \c γ. Must not be negative.
* Set it to 1 to use the classical definition of modularity.
* \param directed Whether to use the directed or undirected version of modularity.
* Ignored for undirected graphs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ igraph_error_t Graph::convert_from_igraph(const igraph_t *graph,
* See https://github.com/igraph/igraph/pull/2043 */
if (G.vertices[i].total_weight == 0) {
/* G.vertices will be destroyed by Graph::~Graph() */
IGRAPH_ERROR("Vertex with zero strength found: all vertices must have positive strength for walktrap",
IGRAPH_ERROR("Vertex with zero strength found: all vertices must have positive strength for walktrap.",
IGRAPH_EINVAL);
}
sort(G.vertices[i].edges, G.vertices[i].edges + G.vertices[i].degree);
Expand Down
Loading