# Measuring how “heavily linked” a node is in a graph

Hello, this is my first post here. I am no mathematician and English is not my first language, so please excuse me if my question is too stupid, it is poorly phrased, or both.

I am developing a program that creates timetables. My timetable-creating algorithm, besides creating the timetable, also creates a graph whose nodes represent each class I have already programmed, and whose arcs represent which pairs of classes should not be programmed at the same time, even if they have to be reprogrammed. The more "heavily linked" a node is, the more inflexible its associated class is with respect to being reprogrammed.

Sometimes, in the middle of the process, there will be no option but to reprogram a class that has already been programmed. I want my program to be able to choose a class that, if reprogrammed, affects the least possible number of other already-programmed classes. That would mean choosing a node in the graph that is "not very heavily linked", subject to some constraints with respect to which nodes can be chosen.

Do you know any algorithms that solve this problem?

-
Your graph is probably represented as a matrix. Take row or column sums. This gives you the "degrees" of nodes. You want to choose something with the smallest degree. Unless I'm missing something, this is not really a question suited to MO. As such I'm voting to close. – Steve Huntsman May 7 '10 at 23:32
The number of immediate neighboring nodes is not of my interest. I want a measure that takes into account neighbors of neighbors, neighbors of neighbors of neighbors, etc. possibly with decreasing weight. – pyon May 7 '10 at 23:53
Then take powers of this matrix. The jkth entry of the nth power gives the number of paths from j to k of length n. Again, row or column sums of this will do the trick. – Steve Huntsman May 7 '10 at 23:59
Alternatively, take a lead from Google and work out the eigenvector with largest eigenvalue. That gives you a pretty good measure of which vertices are most linked, taking into account the linking of the neighbours. – gowers May 8 '10 at 12:31
To generalize @gowers, using the Laplacian and using the eigenvectors to partition the graph gives you a 'sparse cut' which cuts the graph using few edges. There are many variants on this idea - it really depends on what you ultimately want. – Suresh Venkat May 8 '10 at 16:38