I am working on Graphite. Its is in C++ built-in libraries.

I am trying to make a surface which would be a sphere. The sphere is in form of a mesh.

How can I make adjacency matrix and degree matrix for a surface so that I can compute the Laplacian matrix?

I am working on a surface which I need to deform it later for that I need an adjacency matrix and degree matrix for the surface.

I am using C++.
Thanks in advance.