We present a fast and accurate method for solving shallow water flows in large networks. The governing equations consist of the one-dimensional shallow water equations including friction forces. A class of first-order coupling conditions are implemented at the water intersections. Two-dimensional counterparts for simple water networks are also considered for comparison. As a numerical solver for shallow water equations we employed the discontinuous Galerkin method in one and two space dimensions. The method is simple, highly accurate and exhibits enhanced stability properties in the vicinity of sharp gradients which are often present in the solution of shallow water flow problems. The method belongs to a class of locally conservative finite element methods whose approximate solutions are discontinuous across inter-element boundaries. The performance of the proposed techniques is assessed on several applications for shallow water flows in networks. The aim of such a method compared to the conventional two-dimensional simulations is to solve shallow water flows in large networks efficiently and with an appropriate level of accuracy.