Spatial population structure has a variety of evolutionary consequences, for the rate of genetic change as well as which traits are selected. In particular, spatial structure is known to support the evolution of cooperative behaviors. Until recently, mathematical modeling of these phenomena was restricted to symmetric, homogeneous population structures. In this talk, I will present a mathematical formalism that is capable of representing arbitrary forms of spatial structure, as well as arbitrary fitness-affecting interactions. Within this framework, I will show how the fixation probability of a mutant type can be efficiently computed under weak selection. I will then apply this result to evolutionary games on graphs, as a model for the evolution of cooperation. Individuals are situated on a weighted graph, and interact with their neighbors according to a matrix game. Successful strategies reproduce into neighboring vertices. I will derive conditions for a cooperative strategy to be favored on an arbitrary weighted graph. I will conclude with the questions of which networks most favor cooperation, and how to create cooperative networks from non-cooperative ones.