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

Equivalent function to deactivate.edges #11

Open
thednainus opened this issue Feb 4, 2021 · 3 comments
Open

Equivalent function to deactivate.edges #11

thednainus opened this issue Feb 4, 2021 · 3 comments

Comments

@thednainus
Copy link

thednainus commented Feb 4, 2021

I have just started to have a look at the tergmLite package to see if I can make my simulations faster and mayeb use less memory (?) as I am mainly interested in the transmission matrix. My test simulations in the cluster are very slow and using a lot of memory and maybe using tergmLite = TRUE would make it faster.
Is there an equivalent function to deactivate.edges in the tergmLite package? Should I just remove the line below in the delete_vertices function?

https://github.com/statnet/tergmLite/blob/b5a7ccfe054fed7709b0cb6b6e3c93a346ca0342/R/update.R#L128

I don't quite understand what the function shiftVec is doing.

Thanks!

@smjenness
Copy link
Collaborator

It is likely that tergmLite will make your simulations much faster. No, there is no equivalent function for deactivate.edges because tergmLite works only with the cross-sectional edgelist, you can just delete any edges as needed. For example:

edges.to.delete <- XXX
el <- el[-edges.to.delete, , drop = FALSE]

A specialized function for vertices is needed because deleting vertices identified by a positional ID requires shifting the positional IDs of the remaining vertices in the edgelist with a prior higher ID number downward (e.g., node 3 dies, then node 4 becomes node 3, and all of node 4's edges have to updated accordingly). That's what shiftVec does.

@thednainus
Copy link
Author

thednainus commented Feb 4, 2021

The meaning of el is list of edges (edges ID)?
Or Are actually IDs of vertices?

@smjenness
Copy link
Collaborator

el is the edgelist, which is a two-column matrix of edges in the cross section

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

No branches or pull requests

2 participants