Previous | Next --- Slide 26 of 81
Back to Lecture Thumbnails
minglotus

For EDGEMAP_DENSE function, what's the condition that changes so c(i) = 1 is changed to C(i) = 0?

juliob

Is the idea with EDGEMAP_DENSE that looping through all nodes in the graph, and checking the condition might be more inexpensive than looping through the edges of a subset of the nodes, where the number of those edges might exceed the number of nodes in the graph?

huangda

I believe the idea is that for the first implementation, we to give each child a parent. Some graphs, like social network graphs, are structured with significant overlap, so iterating over a node's children will create a lot of duplicated work, since another "parent" probably already visited over them. But we have to explore every child of every node. The second approach is to flip this around and basically assign parents to children, and since we only need one parent, we can break out of the loop when we're done.

Please log in to leave a comment.