Skip to content

Conversation

@joelostblom
Copy link
Contributor

very initial...



#minEdgeCC = 0 #length(outputGraphs)
numGraphs <- length(outputGraphs)
Copy link
Owner

@hyginn hyginn Apr 11, 2017

Choose a reason for hiding this comment

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

outputGraphs undefined. sN?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that should have been sN.

sNEdges <- vector(mode="list", length=numGraphs)
sNVerts <- vector(mode="list", length=numGraphs)
edgePairsList <- c() #vector(mode="list", length=numGraphs)
for (i in 1:numGraphs){
Copy link
Owner

Choose a reason for hiding this comment

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

I would make a hash with keys paste()'ed from incident vertices, and just count occurrences. Our input graphs are simple, so any observation must stem from a different subnetwork. They are also directed, so you don't even have to worry about whether a-b is also b-a (Nb. this problem is usually resolved in undirected graphs by lexically sorting the incident vertices). Just dump the incident edges into a data frame for each input graph, then iterate over the rows, make keys and create a hash entry (if new) or increment its value (if it exists).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Boris. I was trying to create the pasted combined vertices in edgePairs on line 40. I was using a list, and tried to create the count table from that list, but I agree that your strategy makes more sense.

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