plasmo-dev / Plasmo.jl

A Platform for Scalable Modeling and Optimization
Other
143 stars 20 forks source link

Fixed bug in `incidence_matrix(hypergraph)` when graph is not fully connected #100

Closed dlcole3 closed 8 months ago

dlcole3 commented 8 months ago

I found that if I have a graph with nodes that are not fully connected, calling incident_edges(graph, nodes::Vector{OptiNode}) returns an error because of a dimension mismatch here. It looks like this happens because the extension of LightGraphs.incidence_matrix(hypergraph) does not set a dimension when calling SparseArrays.sparse. This PR fixes that by setting the dimension of the sparse matrix.

codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (42f3242) 87.58% compared to head (e042b1b) 87.79%. Report is 4 commits behind head on main.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #100 +/- ## ========================================== + Coverage 87.58% 87.79% +0.21% ========================================== Files 19 19 Lines 2360 2368 +8 ========================================== + Hits 2067 2079 +12 + Misses 293 289 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jalving commented 8 months ago

Thanks @dlcole3!