Implementation of different matrix and vertex cover