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?



Measuring how "heavily linked" a node is in a graph
I suggest you calculate the shortest path between every two nodes. Several algorithm exist for that:


<http://en.wikipedia.org/wiki/Shortest_path>


Then you can give each node a value, based on the shortest path to the other nodes. If the shortest paths are longer, it is less heavily connected.


Of course, you can do other solutions as suggested, but I think an important factor in your calculation is whether you may return to your own node or note. If you don't want take into account going back to your own node, you should base it on shortest paths. If you do want to return, then matrix multiplications is the solution, I think.


