Python: assign custom tag to vertices
It is possible to tag vertices with the bmesh module:

bm = bmesh.from_edit_mesh(obj.data)
#or
bm = bmesh.new()
bm.from_mesh(obj.data)

#create custom data layers
my_id = bm.verts.layers.int.new('id')

#get the custom data layer by its name
my_id = bm.verts.layers.int['id']

#access
bm.verts[0][my_id] = 42

#apply the changes
bmesh.update_edit_mesh(obj.data)
#or
bm.to_mesh(obj.data)