A computer-implemented method comprising: determining, based on a magnetic induction communication channel model, a set of distances between respective sensor locations of a plurality of sensors (212, 214, 216, 218, 220, 222) and respective anchor device locations of at least two anchor devices (208, 210) in a wireless underground sensor network in a hydrocarbon reservoir, wherein the plurality of sensors are disposed at the respective sensor locations within the hydrocarbon reservoir, wherein the at least two anchor devices are disposed at the respective anchor device locations on a dipole antenna inside the hydrocarbon reservoir, and wherein locations of the at least two anchor devices are known; wherein each sensor either includes or is attached to a coil that acts as an antenna for magnetic induction communication, and wherein magnetic induction utilizes the near magnetic field of a first coil to induce a magnetic field in a second coil, establishing a magnetic induction-based localization framework by applying a sequence of algorithms to the determined set of distances and the known locations of the at least two anchor devices, wherein applying the sequence of algorithms comprises first applying a weighted maximum likelihood estimation and then applying a semi-definite programming relaxation to the determined set of distances and the known locations of the at least two anchor devices, after establishing the magnetic induction-based localization framework, determining (500, 600) a first set of sensor locations, wherein the determined first set of sensor locations represents a first estimate of locations of the respective sensor locations within the hydrocarbon reservoir; and wherein determining the first set of sensor locations comprises applying an alternating direction augmented Lagrangian method to the established magnetic induction-based localization framework, after determining the first set of sensor locations, determining (700, 800) a second set of sensor locations based on the determined first set of sensor locations, wherein the determined second set of sensor locations represents a second estimate of locations of the respective sensor locations within the hydrocarbon reservoir and are determined from the magnetic induction-based localization framework wherein determining the second set of sensor locations comprises applying a conjugate gradient algorithm to the determined first set of sensor locations. determining, based on a magnetic induction communication channel model, a set of distances between respective sensor locations of a plurality of sensors (212, 214, 216, 218, 220, 222) and respective anchor device locations of at least two anchor devices (208, 210) in a wireless underground sensor network in a hydrocarbon reservoir, wherein the plurality of sensors are disposed at the respective sensor locations within the hydrocarbon reservoir, wherein the at least two anchor devices are disposed at the respective anchor device locations on a dipole antenna inside the hydrocarbon reservoir, and wherein locations of the at least two anchor devices are known; wherein each sensor either includes or is attached to a coil that acts as an antenna for magnetic induction communication, and wherein magnetic induction utilizes the near magnetic field of a first coil to induce a magnetic field in a second coil, establishing a magnetic induction-based localization framework by applying a sequence of algorithms to the determined set of distances and the known locations of the at least two anchor devices, wherein applying the sequence of algorithms comprises first applying a weighted maximum likelihood estimation and then applying a semi-definite programming relaxation to the determined set of distances and the known locations of the at least two anchor devices, after establishing the magnetic induction-based localization framework, determining (500, 600) a first set of sensor locations, wherein the determined first set of sensor locations represents a first estimate of locations of the respective sensor locations within the hydrocarbon reservoir; and wherein determining the first set of sensor locations comprises applying an alternating direction augmented Lagrangian method to the established magnetic induction-based localization framework, after determining the first set of sensor locations, determining (700, 800) a second set of sensor locations based on the determined first set of sensor locations, wherein the determined second set of sensor locations represents a second estimate of locations of the respective sensor locations within the hydrocarbon reservoir and are determined from the magnetic induction-based localization framework wherein determining the second set of sensor locations comprises applying a conjugate gradient algorithm to the determined first set of sensor locations.