Hi,
You can use MItMeshPolygon and it's method getConnectedFaces to obtain connected polygon id's for each vertex.
For example:
import maya.OpenMaya as OpenMaya
mSelectionList = OpenMaya.MSelectionList()
OpenMaya.MGlobal.getActiveSelectionList(mSelectionList)
mObject = OpenMaya.MObject()
mSelectionList.getDependNode(0, mObject)
polyIterator = OpenMaya.MItMeshPolygon(mObject)
while not polyIterator.isDone():
polygonArray = OpenMaya.MIntArray()
polyIterator.getConnectedFaces(polygonArray)
# do something with polygonArray
polyIterator.next()
The code is just an example of the top of my head. I can't actually check if it works since I don't have access to Maya at the moment :)
Cheers,
Risto