Over the past two decades, water markets have been successfully fielded in countries such as Australia, the United states, Chile, China, etc. Water users, mainly irrigators, have benefited immensely from water markets. However, the current water market design also faces certain serious barriers. It has been pointed out that transaction costs, which exists in most markets, induce great welfare loss. For example, for water markets in western China discussed in this paper, the influence of transaction costs is significant. Another important barrier is the locality of trades due to geographical constraints. Based on the water market at Xiying Irrigation, one of the most successful water market in western China, we model the water market as a graph with minimum transaction thresholds on edges. Our goal is to maximize the transaction volume or welfare. We prove that the existence of transaction costs results in no polynomial time approximation scheme (PTAS) to maximize social welfare (MAX SNP-hard). The complexities on special graphs are also presented. From a practical point of view, however, optimal social welfare can be obtained via a well-designed mixed integer linear program and can be approximated near optimally at a large scale via a heuristic algorithm. Both algorithms are tested on data sets generated from real historical trading data. Our study also suggests the importance of reducing transaction costs, for example, institutional costs in water market design. Our work opens a potentially important avenue of market design within the agenda of computational sustainability.