Target detection is one of the most important services in wireless sensor networks (WSNs) for making decisions about the presence of specified targets by collecting sensed data from geographically distributed wireless sensors nodes. In this paper, we consider designing target detection systems in WSNs on the basis of the Neyman-Pearson Detector (NPD), a statistical decision making method of which accuracy depends on the amount of data collected within a limited time period. We propose the Optimal Multipath Planning Algorithm (OMPA) based on the maximum flow minimum cost algorithm for WSNs to set up paths to reliably deliver as many as possible data packets from data sources to the sink node. OMPA is optimal in the sense that it sets up the maximum number of node-disjoint paths composed of the links with the minimized expected transmission time (ETT). We also evaluate OMPA's decision quality with the help of the Receiver Operating Characteristic (ROC) curves and compare OMPA with the Minimum Cost Path Planning Algorithm (MCPPA) in terms of the detection decision quality and the number of available paths at the presence of node failures.