Skip to content

Commit

Permalink
chore: Update vendored sources to igraph/igraph@e96aeb1
Browse files Browse the repository at this point in the history
chore: update changelog
feat: igraph_is_complete() checks if a graph is complete (igraph/igraph#2510)
Merge pull request igraph/igraph#2525 from igraph/fix/linegraph-keep-loops
do not generate full scanner tables with flex
chore: improve readability of some code
refactor: igraph_degree() now uses the cache when checking for self-loops
refactor: minor readability cleanup for minimum_size_separators()
chore: add note about empty minimal st separator fix
tests: minor cleanup in regression tests
chore: update changelog
fix: correct `is_(minimal_)separator()` for disconnected graphs, fixes igraph/igraph#1480
tests: add more `is_separator()` tests
tests: fix premature memory deallocation in is_separator example
fix: igraph_all_minimal_st_separators() does not return empty separators any more, fixes igraph/igraph#2517
fix: GraphML reader does not accept duplicate attribute names any more, fixes igraph/igraph#2506
fuzzing: assertion readability in vertex separator fuzzer
fuzzing: improve vertex separator fuzzers
docs: doc improvements for ECC and Voronoi
refactor: minor prettification in trie code
fix: assert that keys in a trie are not NULL to make Coverity happy
refactor: improved error messages from C attribute handler (igraph/igraph#2513)
chore: updated changelog
fix: prevent insertion of empty keys in a trie
fix: prevent empty ID attributes for <key> tags in GraphML
docs: change mentions to pointer vectors to vector lists where appropriate & other improvements
fix: -CF causes buffer overflows with Flex, try -Cf instead
fix: bug_2506 test case should not be run if igraph is compiled without GraphML support
ci: run apt-get update in codeql-analysis pipeline
fix: fix attribute value comparison in igraph_read_graph_graphml()
fix: fix duplicate attribute detection in igraph_read_graph_graphml(), fixes igraph/igraph#2506
refactor: make use of IGRAPH_CHECK_OOM() in a few places
style: fix wording for a few warnings
refactor: more detailed error messages in C attribute handler
refactor: experimental `-Cf` option for Flex for better performance at the cost of larger code size. Hopefully this avoids fuzzer timeouts.
fix: `igraph_disjoint_union()` and `igraph_disjoint_union_many()` now check for overflow
chore: Update CONTRIBUTING.md
fuzzing: expand file format round-tripping fuzzers
fix: disallow writing invalid graph attributes to GML files, fixes igraph/igraph#2505
fuzzing: write_all fuzzer fixes
refactor: remove non-exposed igraph_maximum_matching() function whihc was already noted as removed in the 0.10 changelog
fuzzing: activate write_all fuzzer
fuzzing: add cohesive_blocks()
Merge pull request igraph/igraph#2504 from igraph/fix/writing-invalid-lgl-ncol-files
docs: document that `write_graph_graphml()` assumes that strings are UTF-8 encoded, fixes igraph/igraph#2503
docs: mention that the variation of information is in natural units
  • Loading branch information
krlmlr committed Mar 3, 2024
1 parent 7c9f245 commit 336d877
Show file tree
Hide file tree
Showing 32 changed files with 773 additions and 369 deletions.
11 changes: 11 additions & 0 deletions R/aaa-auto.R
Original file line number Diff line number Diff line change
Expand Up @@ -3744,6 +3744,17 @@ tree_from_parent_vector_impl <- function(parents, type=c("out", "in", "undirecte
res
}

is_complete_impl <- function(graph) {
# Argument checks
ensure_igraph(graph)

on.exit( .Call(R_igraph_finalizer) )
# Function call
res <- .Call(R_igraph_is_complete, graph)

res
}

random_spanning_tree_impl <- function(graph, vid=0) {
# Argument checks
ensure_igraph(graph)
Expand Down
2 changes: 1 addition & 1 deletion src/sources.mk

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions src/vendor/cigraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,28 @@

## [master]

### Added

- `igraph_is_complete()` checks there is a connection between all pairs of vertices (experimental function, contributed by Aymeric Agon-Rambosson @aagon in #2510).

### Fixed

- Fixed a corruption of the "finally" stack in `igraph_write_graph_gml()` for certain invalid GML files.
- Fixed a memory leak in `igraph_write_graph_lgl()` when vertex names were present but edge weights were not.
- Fixed the handling of duplicate edge IDs in `igraph_subgraph_from_edges()`.
- Fixed conversion of sparse matrices to dense with `igraph_sparsemat_as_matrix()` when sparse matrix object did not make use of its full allocated capacity.
- `igraph_write_graph_ncol()` and `igraph_write_graph_lgl()` now refuse to write vertex names which would result in an invalid file that cannot be read back in.
- `igraph_write_graph_gml()` now ignores graph attributes called `edge` or `node` with a warning. Writing these would create an invalid GML file that igraph couldn't read back.
- `igraph_disjoint_union()` and `igraph_disjoint_union_many()` now check for overflow.
- `igraph_read_graph_graphml()` now correctly compares attribute values with certain expected values, meaning that prefixes of valid values of `attr.type` are not accepted any more.
- Empty IDs are not allowed any more in `<key>` tags of GraphML files as this is a violation of the GraphML specification.
- `igraph_is_separator()` and `igraph_is_minimal_separator()` now work correctly with disconnected graphs.
- `igraph_linegraph()` now considers self-loops to be self-adjacent in undirected graphs, bringing consistency with how directed graphs were already handled in previous versions.

### Other

- Performance: `igraph_degree()` now makes use of the cache when checking for self-loops.
- The performance of `igraph_is_minimal_separator()` was improved.
- Documentation improvements.

## [0.10.10] - 2024-02-13
Expand Down
3 changes: 3 additions & 0 deletions src/vendor/cigraph/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ to convince the project's developers of the merits of this feature.
<a name="pull-requests"></a>
## Pull requests

_**Note:** The wiki has a lot of useful information for newcomers, as well as a
[quick start guide](https://github.com/igraph/igraph/wiki/Quickstart-for-new-contributors)!_

Good pull requests - patches, improvements, new features - are a fantastic help.
They should remain focused in scope and avoid containing unrelated commits.
Please also take a look at our [tips on writing igraph code](#tips) before
Expand Down
1 change: 1 addition & 0 deletions src/vendor/cigraph/include/igraph_structural.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ IGRAPH_EXPORT igraph_error_t igraph_is_perfect(const igraph_t *graph, igraph_boo
/* Structural properties */
/* -------------------------------------------------- */

IGRAPH_EXPORT igraph_error_t igraph_is_complete(const igraph_t *graph, igraph_bool_t *res);
IGRAPH_EXPORT igraph_error_t igraph_minimum_spanning_tree(const igraph_t *graph, igraph_vector_int_t *res,
const igraph_vector_t *weights);
IGRAPH_EXPORT igraph_error_t igraph_minimum_spanning_tree_unweighted(const igraph_t *graph,
Expand Down
3 changes: 3 additions & 0 deletions src/vendor/cigraph/interfaces/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2512,6 +2512,9 @@ igraph_to_prufer:
igraph_tree_from_parent_vector:
PARAMS: OUT GRAPH graph, INDEX_VECTOR parents, TREE_MODE type=OUT

igraph_is_complete:
PARAMS: GRAPH graph, OUT BOOLEAN res

igraph_minimum_spanning_tree:
PARAMS: GRAPH graph, OUT EDGE_INDICES res, EDGEWEIGHTS weights=NULL
DEPS: res ON graph, weights ON graph
Expand Down
1 change: 1 addition & 0 deletions src/vendor/cigraph/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ add_library(
paths/widest_paths.c

properties/basic_properties.c
properties/complete.c
properties/constraint.c
properties/convergence_degree.c
properties/dag.c
Expand Down
28 changes: 14 additions & 14 deletions src/vendor/cigraph/src/cliques/cliques.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ static igraph_error_t igraph_i_find_k_indsets(
* Patric R. J. Östergård, http://users.aalto.fi/~pat/cliquer.html
*
* \param graph The input graph.
* \param res Pointer to a list of integer vectors, the result will be stored
* here. The pointer vector will be resized if needed.
* \param res Pointer to an initialized list of integer vectors. The cliques
* will be stored here as vectors of vertex IDs.
* \param min_size Integer specifying the minimum size of the cliques to be
* returned. If negative or zero, no lower bound will be used.
* \param max_size Integer specifying the maximum size of the cliques to be
Expand Down Expand Up @@ -280,8 +280,8 @@ igraph_error_t igraph_cliques_callback(const igraph_t *graph,
* \param vertex_weights A vector of vertex weights. The current implementation
* will truncate all weights to their integer parts. You may pass \c NULL
* here to make each vertex have a weight of 1.
* \param res Pointer to a list of integer vectors, the result will be stored
* here. The pointer vector will be resized if needed.
* \param res Pointer to an initialized list of integer vectors. The cliques
* will be stored here as vectors of vertex IDs.
* \param min_weight Integer specifying the minimum weight of the cliques to be
* returned. If negative or zero, no lower bound will be used.
* \param max_weight Integer specifying the maximum weight of the cliques to be
Expand Down Expand Up @@ -326,8 +326,8 @@ igraph_error_t igraph_weighted_cliques(const igraph_t *graph,
* \param vertex_weights A vector of vertex weights. The current implementation
* will truncate all weights to their integer parts. You may pass \c NULL
* here to make each vertex have a weight of 1.
* \param res Pointer to a list of integer vectors, the result will be stored
* here. The pointer vector will be resized if needed.
* \param res Pointer to an initialized list of integer vectors. The cliques
* will be stored here as vectors of vertex IDs.
* \return Error code.
*
* \sa \ref igraph_weighted_cliques(), \ref igraph_weighted_clique_number(), \ref igraph_largest_cliques()
Expand Down Expand Up @@ -413,8 +413,8 @@ static igraph_error_t igraph_i_maximal_or_largest_cliques_or_indsets(
* 6:505--517, 1977.
*
* \param graph The input graph.
* \param res Pointer to a list of integer vectors, the result will be stored
* here. The pointer vector will be resized if needed.
* \param res Pointer to an initialized list of integer vectors. The cliques
* will be stored here as vectors of vertex IDs.
* \param min_size Integer specifying the minimum size of the sets to be
* returned. If negative or zero, no lower bound will be used.
* \param max_size Integer specifying the maximum size of the sets to be
Expand Down Expand Up @@ -537,8 +537,8 @@ igraph_error_t igraph_independent_vertex_sets(const igraph_t *graph,
* 6:505--517, 1977.
*
* \param graph The input graph.
* \param res Pointer to a list of integer vectors, the result will be stored
* here. The pointer vector will be resized if needed.
* \param res Pointer to an initialized list of integer vectors. The cliques
* will be stored here as vectors of vertex IDs.
* \return Error code.
*
* \sa \ref igraph_independent_vertex_sets(), \ref
Expand Down Expand Up @@ -758,8 +758,8 @@ static void free_set_array(igraph_set_t *array, igraph_integer_t n) {
* use \ref igraph_independence_number() instead.
*
* \param graph The input graph.
* \param res Pointer to a list of integer vectors, the result will be stored
* here. The pointer vector will be resized if needed.
* \param res Pointer to an initialized list of integer vectors. The cliques
* will be stored here as vectors of vertex IDs.
* \return Error code.
*
* \sa \ref igraph_maximal_cliques(), \ref
Expand Down Expand Up @@ -948,8 +948,8 @@ static igraph_error_t igraph_i_largest_cliques_store(const igraph_vector_int_t*
* these two versions.
*
* \param graph The input graph.
* \param res Pointer to a list of integer vectors, the result will be stored
* here. The pointer vector will be resized if needed.
* \param res Pointer to an initialized list of integer vectors. The cliques
* will be stored here as vectors of vertex IDs.
* \return Error code.
*
* \sa \ref igraph_cliques(), \ref igraph_maximal_cliques()
Expand Down
7 changes: 2 additions & 5 deletions src/vendor/cigraph/src/cliques/maximal_cliques.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,8 @@ static igraph_error_t igraph_i_maximal_cliques_up(
* almost surely be different between these three versions.
*
* \param graph The input graph.
* \param res Pointer to a pointer vector, the result will be stored
* here, i.e. \p res will contain pointers to \ref igraph_vector_int_t
* objects which contain the indices of vertices involved in a clique.
* The pointer vector will be resized if needed but note that the
* objects in the pointer vector will not be freed. Note that vertices
* \param res Pointer to list of integer vectors. The maximal cliques
* will be returned here as vectors of vertex IDs. Note that vertices
* of a clique may be returned in arbitrary order.
* \param min_size Integer giving the minimum size of the cliques to be
* returned. If negative or zero, no lower bound will be used.
Expand Down
2 changes: 2 additions & 0 deletions src/vendor/cigraph/src/community/community_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ static igraph_error_t igraph_i_split_join_distance(const igraph_vector_int_t *v1
* <code>VI(C_1, C_2) = [H(C_1) - MI(C_1, C_2)] + [H(C_2) - MI(C_1, C_2)]</code>.
* Lower values of the variation of information indicate a smaller difference between
* the two clusterings, with <code>VI = 0</code> achieved precisely when they coincide.
* igraph uses natural units for the variation of information, i.e. it uses the
* natural logarithm when computing entropies.
*
* </para><para>
* The Rand index is defined as the probability that the two clusterings agree
Expand Down
2 changes: 1 addition & 1 deletion src/vendor/cigraph/src/community/fast_modularity.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ igraph_error_t igraph_community_fastgreedy(const igraph_t *graph,
} else {
debug("Calculating degrees\n");
IGRAPH_VECTOR_INT_INIT_FINALLY(&degrees, no_of_nodes);
IGRAPH_CHECK(igraph_degree(graph, &degrees, igraph_vss_all(), IGRAPH_ALL, 1));
IGRAPH_CHECK(igraph_degree(graph, &degrees, igraph_vss_all(), IGRAPH_ALL, true));
for (i = 0; i < no_of_nodes; i++) {
VECTOR(a)[i] = VECTOR(degrees)[i];
}
Expand Down

0 comments on commit 336d877

Please sign in to comment.