Joint operation of power, water, and heating networks is expected to improve overall efficiency of infrastructure while also known as a challenging problem, due to complex couplings of electric, hydraulic, and thermal models that are nonlinear and nonconvex. We formulate an optimal power-water-heat flow (OPWHF) problem and develop a computationally efficient and privacy preserving heuristic to solve it. The proposed heuristic decomposes OPWHF into subproblems, which are solved via convex relaxation and convex-concave procedure while iteratively exchanging information to reach consensus on coupling variables. Simulation results validate that the joint optimization can improve operational flexibility and social welfare of the interconnected system, wherein the water and heating networks respond to time-varying electricity price and electric load as virtual energy storage. We also compare two modes of heating network control: by flow rate and by temperature; case studies reveal that the latter is more effective for most practical systems.