top of page

The Magical Decision Maker Box

GitHub-Mark-120px-plus.png

GitHub Repository

​ —— An interactive optimal solution finder using decision theory algorithms 

In one sentence, this is a box 🗳️ that returns you with a theoretically best choice when you tell it your concerns about decision making.

This program is inspired by a course I took -- Multi-Criteria Decison Making. When I was taking this course at Carnegie Mellon University, many classmates of mine had trouble understanding the algorithms when the professor asked us to calculate the pairwise matrix by hand to solve the widest path problem.

Schulze.png
matr.PNG

Example of a pairwise matrix

(click pic for source)

Example of the widest path problem

(click pic for source)

So I decided to develop a program that interactively visualizes the process of decision making so that my classmates can use it to trace how the algorithms are implemented in a decision-making process, in a drag-n-click, step-by-step fashion.

The goal of this application is to gamify the boring algorithms so that users will easily learn how to make scientific decisions, because I believe that, lecture is not the only way to teach -- making algorithms interactive and gamified is also cool😎!!!

👉Click to Quickly Jump to:

Thus, to develop this program, I have:

  • Designed a gamified box to transform implicit user preferences into theoretically optimal results and visualize the decision-making process

  • Implemented multiple decision science algorithms including Weighted Sum Model, Plurality Voting, Instant Run-off Voting, Borda Voting, and Schulze's Beatpath Method

  • Constructed the user interface from scratch using homemade widgets to power customized interaction components and visual effects, such as click-n-drag, mouse hovering effects, highlight mapping and pop-up windows

User Input
👇What input do I need to feed the box? 

This tool asks for following input:

  1. What decision does the user want to make? (aka. the decision subject)

  2. What choices/candidates does the user have in mind? (aka. the options that will be competing each other)

  3. What are the attributes/features/parameters that the user care about when making this decision?

  4. What are the specifications of each attribute of each candidate? (aka. the specification metric)

  5. What is the weight of each attribute in the user's mind? (aka. how important is each attribute, compared with each other)

  6. What are the sweet spot directions of each attribute? (aka. for each attribute, does the user want the value to be the higher the better?)

Workflow
👇What is the workflow of this box? 

With the input above, the Box will be able to come up with a matrix with the given information, transform the matrix into a rank-based one, and present results reached from different algorithms in the back end. The result will be the winner candidate(s) for the user (sometimes there are several winners if there is a tie).

📍Users can hover the cursor onto the grid so that the highlight mapping shows how each cell is transformed.

matrix.PNG
☝️User input matrix (left) and transformed rank-based matrix

📍Users can drag the competing candidates to the main pathground, and easily arrange the positions at their own will.

🤏User actions:

  • single click to select

  • drag to move nodes

  • double click to release nodes

  • drag and move to arrange positions.

clickndrag.PNG
☝️The Cadidate Battle Ground

📍Select any of the candidates, and click "Show One Way Path", users can examine all the one-way relations between this particular candidate and another.

The arrows and score nodes are spaced intelligently according to the relative positions of the candidates.

Path1.PNG
☝️Step-by-step beathpath relations

📍Select any of the score nodes here, users can check the calculation process of that particular beatpath in the pop-up window.

calc.PNG
☝️Detailed interactable calculations

📍Select any of the score nodes here and click "Show Two Way Path", users can check the two-way beatpaths for more bilateral information.

two-way.PNG
☝️Two-way paths for further explanation

📍Click "Show Smith Set", and the winner among the candidates will be highlighted in gold. Boom! The winner is here.

videoSnap.png
☝️Find the winner -- the Smith Set
Tech Highlights
👇Technical Highlights
  1. Minimal dependency on frameworks: The only framework used here is the built-in Python tkinter. Other than that, this tool does not depend on any modules/frameworks. 

  2. Minimal dependency on data structures: This tool does not rely on data structures from Numpy or Pandas. All the algorithms are reproduced via the simplest structures: sets, tuples, lists and dictionaries.

  3. Zero dependency on existing computer algorithms: I did not refer to any existing algorithms written specifically for computational graph theory problems (such as Floyd–Warshall algorithm, Kosaraju's algorithmTarjan's algorithm) -- I reproduced the whole process by applying the pencil and paper method to the computer program. 

  4. Smart use of backtracking: As this project also serves as my term project for my computer science class, I managed to use backtracking (recursion) to maintain the program complexity with a reasonable efficiency. 

  5. Homemade UI widgets: I hand-coded the very basic components on my own, including click-n-drag, cursor hovering visual effects, intelligent two-way arrow pointing, and smart node spacing to guarantee the quality of the UI.

  6. UI/UX design: This is my first project involving UI/UX design. I did a great job of creating an intuitive and interactive experience due to constant tuning and user testing.

Algorithms
👇Algorithms

© 2020 by Valerie Wang

bottom of page