Skip to content

Conversation

@GroteGnoom
Copy link
Member

Fixes #2196

@codecov
Copy link

codecov bot commented Jul 29, 2023

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.32%. Comparing base (e874c4a) to head (001b147).
⚠️ Report is 1518 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2379   +/-   ##
=======================================
  Coverage   84.31%   84.32%           
=======================================
  Files         380      380           
  Lines       62217    62254   +37     
  Branches    12207    12217   +10     
=======================================
+ Hits        52461    52498   +37     
  Misses       9756     9756           
Files with missing lines Coverage Δ
src/misc/conversion.c 94.33% <100.00%> (+0.51%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e874c4a...001b147. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@szhorvat
Copy link
Member

The time complexity of igraph_get_all_eids_between() should be investigated and included in the docs. It should be logarithmic due to the binary search, but logarithmic in what?

@szhorvat
Copy link
Member

Either way, I suspect this will be too slow. Technically, this function will always take time proportional to the number of matrix elements due to igraph_matrix_null(). But in practice igraph_matrix_null() is extremely fast, and won't dominate the timings. What matters is the other operations.

This particular solution does as many edge lookups as the number of matrix elements, i.e. $N_\text{from} \times N_\text{to}$.

Nevertheless, this implementation is so simple that we can have high confidence in it. Thus let's use it to expand the tests before moving on to implementing a faster one.

What I proposed in the issue using sorted intersections should take time $N_\text{from} \times \langle d \rangle_\text{from}$ where $\langle d \rangle$ denotes the mean degree. I expect that in most practical cases $N_\text{to} &gt;&gt; \langle d \rangle_\text{from}$, but this is not necessarily the case, especially for small submatrices.

So it will be useful to think about various types of applications. Will the submatrices be smaller or larger than the typical degree?

@ntamas
Copy link
Member

ntamas commented Jul 29, 2023

@szhorvat So, am I right to assume in light of your comments that you are in favour of merging this PR even if you have concerns about the performance?

@GroteGnoom is this still a draft or is it ready to be merged?

@szhorvat
Copy link
Member

szhorvat commented Jul 29, 2023

No, I think we should fix the performance.

It is not ready, loop edges are not handled. Although that would be easy with an if (from == to) in the inner loop. LOOPS_ONCE vs LOOPS_TWICE also needs to be handled.

And we need docs.

@GroteGnoom
Copy link
Member Author

GroteGnoom commented Jul 29, 2023

It is not ready, loop edges are not handled.

I think they are? (the TODO can be removed I think)

But it's still a mess, so I'll at least clean up first. And I don't mind looking at performance either.

@szhorvat
Copy link
Member

I think they are? (the TODO can be removed I think)

Sorry about that, I didn't look carefully enough.

@szhorvat szhorvat force-pushed the adjacency_submatrix branch from 16ec9e9 to 001b147 Compare July 6, 2024 20:04
@stale
Copy link

stale bot commented Apr 26, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@szhorvat szhorvat added the todo Triaged for implementation in some unspecified future version label Apr 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

todo Triaged for implementation in some unspecified future version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adjacency matrix for only some vertices

3 participants