Device-to-Device(D2D) communications underlaying cellular networks is as a promising concept which has several advantages over the traditional cellular networks. In TDD system, the frame structure defines the order of uplink and downlink transmission slots. Typically a TDD system is synchronized and the same transmissionorder (TO) is used in all cells. In a direct D2D link, we have the freedom of selecting the TO of the devices freely. To our best knowledge, no paper has explicitly examined the TO optimization problem in D2D communications underlaying cellular network so far. In this paper, we focus exactly on this problem: Once the proper co-channel D2D pairs are determined in the network, how to minimize the network interference by optimally determining the TOs in all D2D links (together with co-channel cellular links) in the network, which is an NP-complete problem. In this paper, we formulate the TO optimization problem from a graph theoretic point of view: i) We show that TO optimization problem is equal to a constraint balanced min-cut graph partitioning problem of our defined augmented graph, ii) we propose and analyze a distributed and a centralized efficient asynchronous clustering algorithm for solving the TO optimization problem, equivalently, for the min-cut of our proposed augmented graph. Computer simulations for TDD-based D2D underlaying cellular network show that the proposed distributed and centralized algorithms, called ABCAMiC and CABCAMiC, respectively, i) remarkably outperform the reference case where all TOs are fixed, and, ii) converge within relatively small number of steps and generally converge in only a few epochs even for large number of cellular and D2D users, and, iii) the expected Manuscript performance of the (partly/fully) distributed ABCAMiC is almost equal to that of the centralized solution CABCAMiC, which generally gives near-global optimal solution to the TO optimization problem.Index Terms-Device-to-Device (D2D) communications underlaying TDD cellular network, transmission order optimization, graph representation of wireless systems, balanced min-cut graph partitioning, clustering. involvement and thus enhancing the BS resource utilization, (and by low transmit power because the MSs are relatively close to each other) or (b) The local MSs still communicate via the BS using the BS uplink (UL) and downlink (DL) resources unnecessarily (and by relatively high transmit powers if the MSs are relatively far from the BS).The answer is clear: Option (a). It's evidently resource inefficient (in terms of transmit power and bandwidth) for two proximate devices to communicate via a relatively far entity (BS) when there is a direct local path between the devices. The idea of re-using the radio resources (same frequency and time) in the spatial domain (due to the propagation loss or due to the fact that some parts of the network are shielded from other areas by natural obstructions etc) is presented in [63], and is not an innovation as pointed out by e.g. [66]. Direct D2D communication be...