Interesting proposed topic. I am sure that you could develop an algorithm to select the resistors to approximate the desired overall resistance. This can be done by ordering the N restitors by size and selcting the first resistor that comes closest to M (the desired resistance) and then interating across the remaining resistors. The algorithm would search for the best resistor to add in series or parrallel to get closer to M. Then the algorithm would search for the third resistor, etc. One of the challenges is to know how many resistors to place into the circuit so that you get as close to the desired value M as possible. I suggest that you also look for a way to access the efficiency of your algorithm. For example, is it providing the optimal solution?
You asked if this algorthim would have practical applications. I doubt if the specific resistor selection problem you described has practical applications. I expect that integrated circuit designers just design the resistor element on the chip to have the dimensions needed to provide the desired resistance.
However, there are many practical problems in which there is no precise formula that provides the correct answer. Search algorithms are created to interate on the possible combinations until an answer of suitable accuracy is found. For example see that attached link for the classic "Bin Packing" problem.http://en.wikipedia.org/wiki/Bin_packing_problem
Best of luck,