Boolean operations on graphs