Question: I have a large (≈ 20 million nodes) directed Graph with in-edges & out-edges. I want to figure out which parts of of the graph deserve the most attention. Often most of the graph is boring, or at least it is already well understood. The way I am defining "attention" is by the concept of "connectedness" i.e. How can i find the most connected node(s) in the graph?

In what follows, One can assume that nodes by themselves have no score, the edges have no weight & they are either connected or not. 

[This website suggest](http://skillicorn.wordpress.com/2010/02/11/a-gentle-introduction-to-finding-the-most-important-node-in-graph-connected-data/) some pretty complicated procedures like n-dimensional space, Eigen Vectors, graph centrality concepts, pageRank etc. Is this problem that complex?

Can I not do a simple Breadth-First Traversal of the entire graph where at each node I figure out a way to find the number of in-edges. The node with most in-edges is the most important node in the graph. Am I missing something here?

Answer: 
Not knowing the real problem your graph solves or the details of your graph, this may not be relevant. But, I suspect your basic solution will be inaccurate in two ways: tie-breaking and what I might call "megalomaniacs." In other words, if you're just counting inbound connections, you'll likely run into nodes with the "same" importance; but, I suspect the intention is that one should be more important. And, in some cases, you may have "islands" of nodes that are all highly interconnected amongst themselves, but loosely so with the majority, yielding nodes that appear much more important than they are (megalomaniacs).

The solution? Well ... Something like pagerank, I imagine!
Algorithms typically try to optimize one thing or the other. Even NP problems are solvable, except that they require all possible combinations to be tried, which makes them computationally expensive. In the problem you are trying to solve, the question is what is it that you are trying to optimize: time, memory, or something else?

Given that it is 2 million nodes, it is unclear whether they are all read in memory at once, or if they reside on disk and thus memory management and minimization of I/O might be a factor.

Assuming that your entire graph is in memory, the question is who creates the graph? Can you keep a count of the edges for nodes in the graph during creation (or when reading from disk) and keep them in an ordered list?

The other thing is that sometimes a graph can have two or more completely disconnected parts in practical life (I have had to deal with one such graph). In such cases, I have found it more useful to iterate through all the nodes (no matter breadth first or depth first), and then count all the edges on every node -- in most cases, modern languages will keep all the edges in some sort of a collection and you will already have a property or method to get the length or count on that collection, thus saving iteration over all the edges).

The complexity for both these solutions can be O(n log n) where n is the no. of nodes.

Although time and memory is often of concern, but sometimes simplicity is more important than those attributes, so I keep that in my equation too. In many situations, such as this, I would consider complexity of implementation as yet another factor in my pro/con list before deciding what to implement.