Triangle List <-> Adjacency List
- To: mathgroup at smc.vnet.net
- Subject: [mg30466] Triangle List <-> Adjacency List
- From: Kashif Rasul <kashif at vpac.org>
- Date: Thu, 23 Aug 2001 02:15:31 -0400 (EDT)
- Organization: VPAC
- Sender: owner-wri-mathgroup at wolfram.com
Hi there, I was wondering if anyone knows of a quick way of converting a list of triangle corners, eg. for a triangulation like: 0 1 o------o | /| | / | | / | | / | | / | | / | |/ | o------o 2 3 the triangle list will be {{0,2,1},{1,2,3}}, i.e. the first triangle's first corner is at index [1], followed by its other two corners in counterclockwise order etc.; into a list which represents the adjacency structure of the graph, e.g. for the above triangulation, it will be: {{1,2},{0,2,3},{0,1,3},{1,2}}, node 0 is conected to node 1 and 2, etc. Also it might be helpfull to go the other way too from an adjacency list to a triangle list. Thank you in advance. Kashif