I have shapefile with polygons and I test topology - overlaps, duplicates and gaps. I tested it in QGIS and now I have to describe algorithms, which uses QGIS for this rules. I must write research algorithms. I finded just general description: http://docs.qgis.org/2.0/en/docs/gentle_gis_introduction/topology.html and http://qgis.org/en/docs/user_manual/plugins/plugins_topology_checker.html but I can´t find algorithms.
QGIS code is hosted on Github. I suggest you start your search there, e.g. https://github.com/qgis/QGIS/search?p=2&q=topology&ref=cmdform
If you know exactly which tool you want to research, it should be easier to find the corresponding piece of code.