Improved graph detection