Edit distance function
Do you want unsigned int or do you want std::size_t?

unsigned int edit_distance(const vector&lt;string&gt; &amp;s1, const vector&lt;string&gt; &amp;s2)


It comes down to what you are trying to convey.
The use of string and vector suggests you are doing using namespace std; try not to do this. Prefer to qualify your types: std::string and std::vector.

Personally, I prefer const on the right. But it's only a preference thing.

Only declare one variable per line:

    const size_t len1 = s1.size(), len2 = s2.size();


Come up with better names. d is not very descriptive.

    vector&lt;vector&lt;unsigned int&gt;&gt; d(len1 + 1, vector&lt;unsigned int&gt;(len2 + 1));


I would prefer std::size_t here:

    for(unsigned int i = 1; i &lt;= len1; ++i) d[i][0] = i;