Vote condorcet winner

vote-condorcet-winner · version 1.0.0 · Optimization & voting · free, no key needed

Compute weighted pairwise counts, a strict Condorcet winner, and the generalized Smith set.

Use when you need to: compute Condorcet winner · calculate pairwise preference matrix · find Smith set.

Decide before calling

Read the versioned contract and the supported scope below. Reuse vote-condorcet-winner@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use vote-condorcet-winner@1.0.0 for compute Condorcet winner. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "candidates": [
    "A",
    "B"
  ],
  "ballots": [
    {
      "ranking": [
        [
          "A"
        ],
        [
          "B"
        ]
      ],
      "weight": 3
    },
    {
      "ranking": [
        [
          "B"
        ],
        [
          "A"
        ]
      ],
      "weight": 1
    }
  ],
  "missing_candidate_policy": "ranked-over-missing"
}

Response:

{
  "result": {
    "candidates": [
      "A",
      "B"
    ],
    "pairwise": [
      {
        "candidate": "A",
        "counts": [
          0,
          3
        ]
      },
      {
        "candidate": "B",
        "counts": [
          1,
          0
        ]
      }
    ],
    "compared_weight": [
      {
        "candidate": "A",
        "counts": [
          0,
          4
        ]
      },
      {
        "candidate": "B",
        "counts": [
          4,
          0
        ]
      }
    ],
    "condorcet_winner": "A",
    "smith_set": [
      "A"
    ],
    "audit": {
      "ballot_count": 2,
      "total_weight": 4,
      "complete_weight": 4,
      "truncated_weight": 0,
      "tied_weight": 0
    }
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "vote-condorcet-winner",
  "version": "1.0.0",
  "input": {
    "candidates": [
      "A",
      "B"
    ],
    "ballots": [
      {
        "ranking": [
          [
            "A"
          ],
          [
            "B"
          ]
        ],
        "weight": 3
      },
      {
        "ranking": [
          [
            "B"
          ],
          [
            "A"
          ]
        ],
        "weight": 1
      }
    ],
    "missing_candidate_policy": "ranked-over-missing"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/vote-condorcet-winner/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"candidates":["A","B"],"ballots":[{"ranking":[["A"],["B"]],"weight":3},{"ranking":[["B"],["A"]],"weight":1}],"missing_candidate_policy":"ranked-over-missing"}'

The machine-readable contract is at /v1/tools/vote-condorcet-winner/versions/1.0.0.

CLI

node cli.mjs run vote-condorcet-winner 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.