|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
The MPC-DisCSP4 algorithm for DisCSP with privacy guarantees. More...

Classes | |
| enum | Phase |
| A phase of the algorithm. More... | |
| enum | MultiPhase |
| The phases in a multiplication operation. More... | |
Public Member Functions | |
| MPC_DisCSP4 (DCOPProblemInterface< V, AddableInteger > problem, Element params) | |
| Constructor. | |
| void | setQueue (Queue queue) |
| Collection< MessageType > | getMsgTypes () |
| void | notifyIn (Message msg) |
| Public Member Functions inherited from frodo2.communication.IncomingMsgPolicyInterface< T > | |
| default void | notifyIn (Message msg, Object toAgent) |
| Notifies the listener of an incoming message. | |
Protected Member Functions | |
| MPC_DisCSP4 (DCOPProblemInterface< V, AddableInteger > problem, Element params, AddableInteger plusinf) | |
| Constructor. | |
| void | terminate () |
| Terminates. | |
| void | nextMultiplication () |
| Moves to the next vector multiplication, if any remains. | |
| void | revealSol () |
| Reveals to each agent all shares of its variables' optimal values. | |
| void | processPending () |
| Processes pending messages. | |
| void | findFirstSolution () |
| Initiates the arithmetic circuit on S that singles out its first 1 entry. | |
| void | init () |
| Parses the problem. | |
| void | recordCandidateSol (AddableInteger publicCost, AddableInteger privateCost, List< BigInteger > sPrimePrime) |
| Records a candidate solution. | |
| void | share0 () |
| Creates and sends share of 0. | |
| void | shareVectorOfZeros () |
| Shares a vector full of zeros. | |
Protected Attributes | |
| Queue | queue |
| The queue used to exchange messages. | |
| DCOPProblemInterface< V, AddableInteger > | problem |
| The problem. | |
| boolean | started = false |
| Whether the algorithm has been started. | |
| ArrayList< String > | agents |
| The agents in lexicographic order. | |
| int | nbrAgents |
| The number of agents. | |
| int | myAgentID |
| This agent's index in the ordered list of agents. | |
| int | nbrSols |
| The number of publicly feasible solutions. | |
| final BigInteger | modulo |
| Shamir secret shares are modulo this number. | |
| BigInteger[] | Sprime |
| The vector S' of Shamir shares of the feasibility of each publicly feasible solution. | |
| final PaillierCryptoScheme | cryptoScheme |
| The Paillier crypto scheme. | |
| BigInteger[] | S |
| The vector S of Shamir shares of whether each solution is the optimal one. | |
| BigInteger | hi |
| When computing the vector S, the previous value of h. | |
| BigInteger | Si |
| When computing the vector S, the previous value of Si. | |
| Phase | phase = Phase.SprimePrime |
| The current phase. | |
| int | step = 0 |
| A step of computation. | |
| MultiPhase | multiPhase = MultiPhase.randomize |
| The current phase of the current multiplication operation. | |
| boolean | currStep = false |
| Boolean used to identify received messages that belong to the next phase and should be postponed. | |
| int | sharesCount = 0 |
| Counter used to keep track of the number of shares exchanged. | |
| ArrayList< Message > | pendingMsgs = new ArrayList<Message> () |
| Messages received too early to be processed. | |
Private Member Functions | |
| BigInteger[][] | newVectorOfSharesOf0 () |
| void | share (BigInteger nbr) |
| Shares a number with all agents. | |
| void | shareVector (List< BigInteger > vector) |
| Shares a secret vector with all agents. | |
| BigInteger[] | randPoly (BigInteger at0) |
| Creates a random polynomial. | |
| BigInteger | evaluate (BigInteger[] poly, BigInteger x) |
| Evaluates a polynomial P at x. | |
Private Attributes | |
| ArrayList< int[] > | solIndex |
| For each entry in the S vector, for each variable, the index of its value in its domain. | |
| int | deg = -1 |
| The degree of the polynomials in Shamir's secret sharing scheme. | |
| BigInteger[] | agentXvalues |
| For each agent, its X value used to evaluate polynomials. | |
| SecureRandom | rand = new SecureRandom () |
| A source of randomness. | |
| TreeMap< Integer, BigInteger[] > | SprimePrime = new TreeMap < Integer, BigInteger[] > () |
| For each agent, its S'' vector. | |
| int[] | permutation |
| A random permutation used to shuffle the vectors. | |
| int[] | inversePerm |
| The inverse permutation. | |
| BigInteger[][] | vectOfShares |
| A vector of shares. | |
| BigInteger[] | shares |
| Shares. | |
| BigInteger[] | lagrange |
| The coefficients used for Lagrange interpolation. | |
| int | encrSharesCount = 0 |
| Counter used to keep track of the number of encrypted shares exchanged. | |
| String[] | vars |
| The ordered list of variables participating in public constraints. | |
| HashMap< String, BigInteger[] > | solShares |
| Shares of the feasible values for my variables. | |
| HashMap< String, V > | solution |
| The feasible solution found, if any. | |
| Matrix | reductor |
| The matrix used to reduce the degree of a product polynomial. | |
| final AddableInteger | plusinf |
| The infinite cost value. | |
The MPC-DisCSP4 algorithm for DisCSP with privacy guarantees.
MPC-DisCSP4 is described in the following paper:
Marius-Calin Silaghi. Hiding absence of solution for a distributed constraint satisfaction problem (poster). In Proceedings of the Eighteenth International Florida Artificial Intelligence Research Society Conference (FLAIRS'05), pages 854-855, Clearwater Beach, FL, USA, May 15-17 2005. AAAI Press.
| <V> | the type used for variable values |
| frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.MPC_DisCSP4 | ( | DCOPProblemInterface< V, AddableInteger > | problem, |
| Element | params ) |
|
protected |
Constructor.
| problem | the overall problem |
| params | the parameters |
| plusinf | The infinite cost value |
References plusinf, problem, and frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.setUtilClass().

|
private |
Evaluates a polynomial P at x.
| poly | the polynomial P |
| x | the value |
Referenced by newVectorOfSharesOf0(), share(), share0(), and shareVector().
|
protected |
Initiates the arithmetic circuit on S that singles out its first 1 entry.
References frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.MultiPhase.randomize, revealSol(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.Phase.S, and share0().
Referenced by nextMultiplication(), and notifyIn().

| Collection< MessageType > frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.getMsgTypes | ( | ) |
Implements frodo2.communication.MessageListener< T >.
References frodo2.algorithms.mpc_discsp.EncrSharesMsg.ENCR_SHARES_MSG_TYPE, frodo2.algorithms.mpc_discsp.OneShareMsg.ONE_SHARE_MSG, frodo2.algorithms.mpc_discsp.SharesMsg.SHARES_MSG_TYPE, frodo2.algorithms.mpc_discsp.SolShareMsg.SOL_SHARE_MSG_TYPE, and frodo2.algorithms.AgentInterface< V extends Addable< V > >.START_AGENT.
|
protected |
Parses the problem.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.ProjOutput< V extends Addable< V >, U extends Addable< U > >.assignments, deg, frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getAgent(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getAgents(), frodo2.solutionSpaces.SolutionSpace< V extends Addable< V > >.SparseIterator< V >.getCurrentSolution(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getDomain(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getMyVars(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getNbrIntVars(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getNbrVars(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getOwner(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSolutionSpaces(), frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.getUtility(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getVariables(), frodo2.algorithms.mpc_discsp.Matrix.identity(), init(), frodo2.algorithms.mpc_discsp.Matrix.inverse(), frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.join(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.maximize(), nbrAgents, newVectorOfSharesOf0(), frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.SparseIterator< V, U >.nextUtility(), frodo2.solutionSpaces.AddableInteger.PlusInfinity.PLUS_INF, plusinf, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.projectAll(), recordCandidateSol(), frodo2.communication.Queue.sendMessage(), frodo2.communication.Queue.sendMessageToSelf(), frodo2.algorithms.mpc_discsp.Matrix.set(), shareVector(), frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.ProjOutput< V extends Addable< V >, U extends Addable< U > >.space, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.sparseIter(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, frodo2.algorithms.mpc_discsp.Matrix.times(), and vars.
Referenced by init(), and notifyIn().

|
private |
References agentXvalues, evaluate(), share(), and shares.
Referenced by init(), nextMultiplication(), notifyIn(), and shareVectorOfZeros().

|
protected |
Moves to the next vector multiplication, if any remains.
References frodo2.algorithms.mpc_discsp.PaillierPublicKey.encrypt(), frodo2.algorithms.mpc_discsp.PaillierPublicKey.fakeEncrypt(), findFirstSolution(), newVectorOfSharesOf0(), processPending(), frodo2.algorithms.mpc_discsp.PaillierCryptoScheme.publicKey, frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.MultiPhase.randomize, frodo2.communication.Queue.sendMessage(), shareVectorOfZeros(), and frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.Phase.shuffling.
Referenced by notifyIn().

| void frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.notifyIn | ( | Message | msg | ) |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, frodo2.algorithms.mpc_discsp.PaillierCryptoScheme.decrypt(), frodo2.algorithms.mpc_discsp.EncrSharesMsg.ENCR_SHARES_MSG_TYPE, frodo2.algorithms.mpc_discsp.PaillierPublicKey.encrypt(), frodo2.communication.MessageType.equals(), frodo2.algorithms.mpc_discsp.PaillierPublicKey.fakeEncrypt(), findFirstSolution(), frodo2.algorithms.mpc_discsp.OneShareMsg.getAgent(), frodo2.algorithms.mpc_discsp.SharesMsg.getAgent(), frodo2.algorithms.mpc_discsp.EncrSharesMsg.getAgentID(), frodo2.algorithms.mpc_discsp.Matrix.getArray(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getDomain(), frodo2.algorithms.mpc_discsp.EncrSharesMsg.getPublicKey(), frodo2.algorithms.mpc_discsp.SolShareMsg.getSender(), frodo2.algorithms.mpc_discsp.OneShareMsg.getShare(), frodo2.algorithms.mpc_discsp.EncrSharesMsg.getShares(), frodo2.algorithms.mpc_discsp.SharesMsg.getShares(), frodo2.algorithms.mpc_discsp.SolShareMsg.getShares(), frodo2.communication.Message.getType(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getVariables(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.Phase.h, init(), newVectorOfSharesOf0(), nextMultiplication(), frodo2.algorithms.mpc_discsp.OneShareMsg.ONE_SHARE_MSG, processPending(), frodo2.algorithms.mpc_discsp.PaillierCryptoScheme.publicKey, frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.MultiPhase.randomize, frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.MultiPhase.reveal, revealSol(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.Phase.S, frodo2.communication.Queue.sendMessage(), frodo2.communication.Queue.sendMessageToSelf(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.MultiPhase.share, share(), share0(), shares, frodo2.algorithms.mpc_discsp.SharesMsg.SHARES_MSG_TYPE, shareVector(), shareVectorOfZeros(), frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.Phase.shuffling, frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.Phase.sol, frodo2.algorithms.mpc_discsp.SolShareMsg.SOL_SHARE_MSG_TYPE, frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.Phase.SprimePrime, frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, frodo2.algorithms.mpc_discsp.EncrSharesMsg.step, frodo2.algorithms.mpc_discsp.OneShareMsg.step, frodo2.algorithms.mpc_discsp.SharesMsg.step, frodo2.algorithms.mpc_discsp.SolShareMsg.step, terminate(), frodo2.algorithms.mpc_discsp.Matrix.times(), and frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.Phase.vectorMultiplication.

|
protected |
Processes pending messages.
References frodo2.communication.Queue.sendMessageToSelf().
Referenced by nextMultiplication(), notifyIn(), share(), share0(), shareVector(), and shareVectorOfZeros().

|
private |
Creates a random polynomial.
| at0 | value of the polynomial at 0 |
References deg.
Referenced by share(), and shareVector().
|
protected |
Records a candidate solution.
| publicCost | the public cost of the candidate solution |
| privateCost | the private cost of the candidate solution |
| sPrimePrime | the vector of private costs of candidate solutions |
References frodo2.solutionSpaces.AddableInteger.add(), frodo2.solutionSpaces.AddableInteger.equals(), frodo2.solutionSpaces.AddableInteger.intValue(), and frodo2.solutionSpaces.AddableInteger.PlusInfinity.PLUS_INF.
Referenced by init().

|
protected |
Reveals to each agent all shares of its variables' optimal values.
References frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getVariables(), frodo2.communication.Queue.sendMessage(), and solShares.
Referenced by findFirstSolution(), and notifyIn().

| void frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.setQueue | ( | Queue | queue | ) |
Implements frodo2.communication.MessageListener< T >.
References queue.
|
private |
Shares a number with all agents.
| nbr | the secret number |
References evaluate(), nbrAgents, processPending(), randPoly(), frodo2.communication.Queue.sendMessage(), and share().
Referenced by newVectorOfSharesOf0(), notifyIn(), share(), share0(), shareVector(), and shareVectorOfZeros().

|
protected |
Creates and sends share of 0.
References evaluate(), nbrAgents, processPending(), frodo2.communication.Queue.sendMessage(), and share().
Referenced by findFirstSolution(), and notifyIn().

|
private |
Shares a secret vector with all agents.
| vector | the secret vector |
References agentXvalues, deg, evaluate(), nbrAgents, nbrSols, processPending(), randPoly(), frodo2.communication.Queue.sendMessage(), and share().
Referenced by init(), and notifyIn().

|
protected |
Shares a vector full of zeros.
References nbrAgents, newVectorOfSharesOf0(), processPending(), frodo2.communication.Queue.sendMessage(), share(), and shares.
Referenced by nextMultiplication(), and notifyIn().

|
protected |
Terminates.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getVariables(), frodo2.communication.Queue.sendMessage(), frodo2.communication.Queue.sendMessageToSelf(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, and vars.
Referenced by notifyIn().

|
protected |
The agents in lexicographic order.
|
private |
For each agent, its X value used to evaluate polynomials.
Referenced by newVectorOfSharesOf0(), and shareVector().
|
protected |
The Paillier crypto scheme.
|
protected |
Boolean used to identify received messages that belong to the next phase and should be postponed.
|
private |
The degree of the polynomials in Shamir's secret sharing scheme.
Referenced by init(), randPoly(), and shareVector().
|
private |
Counter used to keep track of the number of encrypted shares exchanged.
|
protected |
When computing the vector S, the previous value of h.
|
private |
The inverse permutation.
|
private |
The coefficients used for Lagrange interpolation.
|
protected |
Shamir secret shares are modulo this number.
|
protected |
The current phase of the current multiplication operation.
|
protected |
This agent's index in the ordered list of agents.
|
protected |
The number of agents.
Referenced by init(), share(), share0(), shareVector(), and shareVectorOfZeros().
|
protected |
The number of publicly feasible solutions.
Referenced by shareVector().
|
protected |
Messages received too early to be processed.
|
private |
A random permutation used to shuffle the vectors.
|
protected |
The current phase.
|
private |
The infinite cost value.
Referenced by init(), and MPC_DisCSP4().
|
protected |
The problem.
Referenced by MPC_DisCSP4(), and MPC_DisCSP4().
|
protected |
The queue used to exchange messages.
Referenced by setQueue().
|
private |
A source of randomness.
|
private |
The matrix used to reduce the degree of a product polynomial.
It is V^-1 * P * V, where V is the Vandermonde matrix, and P is a projection.
|
protected |
The vector S of Shamir shares of whether each solution is the optimal one.
|
private |
Shares.
Referenced by newVectorOfSharesOf0(), notifyIn(), and shareVectorOfZeros().
|
protected |
Counter used to keep track of the number of shares exchanged.
|
protected |
When computing the vector S, the previous value of Si.
|
private |
For each entry in the S vector, for each variable, the index of its value in its domain.
|
private |
Shares of the feasible values for my variables.
Referenced by revealSol().
|
private |
The feasible solution found, if any.
|
protected |
The vector S' of Shamir shares of the feasibility of each publicly feasible solution.
|
private |
For each agent, its S'' vector.
These vectors must be multiplied element-wise to obtain S'
|
protected |
Whether the algorithm has been started.
|
protected |
A step of computation.
|
private |
The ordered list of variables participating in public constraints.
Referenced by init(), and terminate().
|
private |
A vector of shares.