graph version of shadow filling (bad)