1. A method performed by a cloud controller for assigning compute nodes to data nodes, the method comprising: obtaining, by the cloud controller, a set of compute nodes, a set of data nodes, and a set of edges between compute nodes and data nodes; determining an assignment objective to be achieved in assigning compute nodes from the set of compute nodes to data nodes from the set of data nodes; and assigning a compute node of the set of compute nodes to a data node of the set of data nodes based on the assignment objective and a plurality of costs associated with the set of edges; wherein the assignment objective is based on a latency cost used in obtaining a set of assignments by applying an algorithm.