I need help with a graph problem. What is the fastest way to convert a obj style mesh information (list of vertices, list of faces) into an adjacency list (for every mesh node a list of integers indicating all the nodes that node shares edges with)? My first approach is:
- to first get all the single edges (startIndexNode, endIndexNode)
- delete the duplicates using a nested for loop
- loop over nodes and compare all edges (startIndexNode, endIndexNode) with the node index
This is expensive and takes way to long. What is a good strategy for this graph problem? Any help is very much appreciated.