Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deficiency one and concnetration robustness #964

Merged
merged 27 commits into from
Jul 26, 2024
Merged

Conversation

vyudu
Copy link
Collaborator

@vyudu vyudu commented Jun 18, 2024

Concentration robustness for deficiency one networks. Relies on strong and terminal linkage classes.

@isaacsas
Copy link
Member

This needs to be updated to master.

src/network_analysis.jl Outdated Show resolved Hide resolved
src/network_analysis.jl Outdated Show resolved Hide resolved
src/network_analysis.jl Outdated Show resolved Hide resolved
src/reactionsystem.jl Show resolved Hide resolved
src/network_analysis.jl Show resolved Hide resolved

for (c_s, c_p) in collect(Combinatorics.combinations(nonterminal_complexes, 2))
# Check the difference of all the combinations of complexes. The support is the set of indices that are non-zero
supp = findall(!=(0), Z[:, c_s] - Z[:, c_p])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The column difference could be stored in a pre-calculated vector from outside the loop like

@. tmp = @views Z[:, c_2] - Z[:, c_p]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More generally, seems like this could be written as a non-allocating loop that bails if a second match is found instead of continuing the search, and if a second match isn't found saves it in robust_species.

Copy link
Collaborator Author

@vyudu vyudu Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re the first comment: would I accomplish the same thing by adding @views in the supp line, so it becomes

supp = findall(!=(0), @views Z[:, c_s] - Z[:, c_p])

Seems like allocating it entirely outside might take a lot of space (would have to be a 3D array, where each difference vector is indexed by (c_s, c_p))

For the second comment, what do you mean by second match? I don't immediately see a way to skip a check for a species we already know is robust because we can't know that it's in the support of a difference of two complexes until we calculate it

@isaacsas
Copy link
Member

@vyudu LGTM. Feel free to merge at your leisure.

@vyudu vyudu merged commit 87d02ff into SciML:master Jul 26, 2024
5 checks passed
@vyudu vyudu deleted the deficiency-one branch November 11, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants