Parallel resistor algorithm
Does anybody have an idea of how this could be implemented, without
  looping through all the possible values?


It's called successive approximation and is used quite effectively in determining the digital value of an analogue signal. So, with 4 resistors you would make 4 decisions in order to decide which of the 15 values above zero was most appropriate: -



To make this work like an ADC, feed the unknown resistor with a constant current and do the same for the controllable resistance. Then feed both signals to a comparator that "makes the decision".

Alternatively, buy a cheap ADC and throw away your transistor and resistor network in favour of a much more stable R-2R network and inbuilt algorithm.