pydcop distribute

pydcop distribute distributes a the computations for a DCOP over a set of agents.

Synopsis

pydcop distribute --distribution <distribution_method>
                  [--cost <distribution_method_for cost>]
                  [--graph <graph_model>]
                  [--algo <dcop_algorithm>] <dcop-files>

Description

Distributes the computation used to solve a DCOP.

The distribution obtained is written in yaml on standard output. It can also be written into a file by using the --output global option. The output file can be used as an input for several commands that accept a distribution (e.g. orchestrator, solve, run)

Options

--distribution <distribution_method> / -d <distribution_method>

The distribution algorithm (oneagent, adhoc, ilp_fgdp, etc., see DCOP computation distribution).

--cost <distribution_method_for_cost>

A distribution method that can be used to evaluate the cost of a distribution. If not given, defaults to <distribution_method>. If the distribution method does not define cost, a cost None will be returned in the command output.

--algo <dcop_algorithm> / -a <dcop_algorithm>

The (optional) algorithm whose computations will be distributed. It is needed when the distribution depends on the computation’s characteristics (which depend on the algorithm). For example when the distribution is based on computations footprint of communication load, the dcop algorithm is needed.

--graph <graph_model> / -g <graph_model>

The (optional) computation graph model, one of factor_graph, pseudotree, constraints_hypergraph (see. DCOP graph models) The set of computation to distribute depends on the graph model used to represent the DCOP. When the --algo option is used, it is not required as the graph model can be deduced from the DCOP algorithm.

<dcop-files>

One or several paths to the files containing the dcop. If several paths are given, their content is concatenated as used a the yaml definition for the DCOP.

Examples

Distributing a DCOP for dsa, hence modeled as a constraints graph, using the ilp_compref distribution method:

pydcop distribute -d ilp_compref -a dsa \
                  graph_coloring_10_4_15_0.1_capa_costs.yml

Distributing a DCOP modelled as a factor graph. The DCOP algorithm is not required here as the oneagent distribution algorithm does not depends on the computation’s characteristics (as it simply assign one computation to each agent):

pydcop distribute --graph factor_graph \
                  --dist oneagent graph_coloring1.yaml

The following command gives the same result. Here, we can deduce the required graph model, as maxsum works on a factor graph:

pydcop distribute --algo maxsum \
                  --dist oneagent graph_coloring1.yaml

Example output:

cost: 0
distribution:
  a1: [v3]
  a2: [diff_1_2]
  a3: [diff_2_3]
  a4: [v1]
  a5: [v2]
inputs:
  algo: null
  dcop: [tests/instances/graph_coloring1.yaml]
  dist_algo: oneagent
  graph: factor_graph