Help with an incidence matrix


I need help with an incidence matrix, which is the representation of a graph in an environment in JAVA, I began to structure this using jCUDA. I tried to pass a vector but I’m having the following doubts columns in the matrix represents the relations between vertices, since each vertex has six edges.

I was thinking about how to upgrade the environment in JAVA, then the many processes that may occur on the matrix, because the environment will result from the environment in JAVA.

Anyone have any idea?