1. A method for controlling network connected devices, comprising: receiving a command; using a processor to apply a graph model to identify a subset of nodes related to the command, wherein the graph model includes a plurality of nodes that each correspond to a device and the graph model includes a plurality of edges that specify relationships between the plurality of nodes, at least one of the plurality of nodes of the graph model corresponds to a physical area within a larger physical deployment environment, and at least one of the plurality of edges specifies a physical spatial relationship between corresponding nodes connected by the at least one corresponding edge; and activating the subset of nodes in response to the command, wherein activating the subset of nodes includes automatically controlling at least a portion of the network connected devices, using a result of the activation of the subset of nodes in evaluating a plurality of output candidates according to an optimization function, and selecting an output that optimizes the optimization function among the output candidates; and receiving a feedback associated with the output and updating one or more reference optimization evaluation values based at least in part on the received feedback; and wherein the subset of nodes related to the command is identified including by identifying a specific node of the subset of nodes as being associated with an associated physical area of the command within the larger physical deployment environment and identifying one or more of the network connected devices associated with the associated physical area including by identifying one or more other nodes of the subset of nodes connected to the identified specific node by one or more physical spatial relationship identifying edges.