fix memory overflow for 8000 pictures

therefore, 1. calculate co_occurrence on the fly
2. write edge weightings after 1000 new entries to file
extract method for tf idf calculation to make garbage collection possible
fix compiling error
Merge branch 'master' of github.com:nicolas-fricke/semmul2013-group1