Maximum matching in graph of any type