We derive and analyse a new iterative algorithm for detecting network core-periphery structure. Using techniques in nonlinear Perron-Frobenius theory, we prove global convergence to the unique solution of a relaxed version of a natural discrete optimization problem. On sparse networks, the cost of each iteration scales linearly with the number of nodes, making the algorithm feasible for large-scale problems. We give an alternative interpretation of the algorithm from the perspective of maximum likelihood reordering of a new logistic core-periphery random graph model. This viewpoint also gives a new basis for quantitatively judging a core-periphery detection algorithm. We illustrate the algorithm on a range of synthetic and real networks, and show that it offers advantages over the current state-of-the-art.1. Motivation. Large, complex networks record pairwise interactions between components in a system. In many circumstances, we wish to summarize this wealth of information by extracting high-level information or visualizing key features. Two of the most important and well-studied tasks are• clustering, also known as community detection, where we attempt to subdivide a network into smaller modules such that nodes within each module share many connections and nodes in distinct modules share few connections, and • determination of centrality or rank, where we assign a nonnegative value to each node such that a larger value indicates a higher level of importance. A distinct but closely related problem is to assign each node to either the core or periphery in such a way that core nodes are strongly connected across the whole network whereas peripheral nodes are strongly connected only to core nodes; hence there are relatively weak periphery-periphery connections. More generally, we may wish to assign a non-negative value to each node, with a larger value indicating greater "coreness." The images in the centre and right of Figure 1 indicate the two-by-two block pattern associated with a core-periphery structure.The core-periphery concept emerged implicitly in the study of economic, social and scientific citation networks, and was formalized in a seminal paper of Borgatti and Everett [3]. A review of recent work on modeling and analyzing core-periphery structure, and related ideas in degree assortativity, rich-clubs and nested/bow-tie/onion networks, can be found in [9]. We focus here on the issue of detection: given a large complex network with nodes appearing in arbitrary order, can we discover, quantify and visualize any inherent core-periphery organization?In the next section, we set up our notation and discuss background material. Many detection algorithms can be motivated from an optimization perspective. In section 3 we use such an approach to define and justify the logistic core-periphery *