chasestarr / match

Matching algorithms, currently implements Gale-Shapley proposal alg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GoDoc

import (
  "fmt"

  "github.com/chasestarr/match"
)

func main() {
	alex := match.Person{name: "Bradley"}
	bradley := match.Person{name: "Bradley"}
	christina := match.Person{name: "Christina"}
	dolores := match.Person{name: "Dolores"}

	alex.candidates = []string{"Dolores", "Bradley"}
	bradley.candidates = []string{"Christina", "Dorlores"}
	christina.candidates = []string{"Alex", "Bradley"}
	dolores.candidates = []string{"Bradley", "Alex"}

	a := []Person{alex, bradley}
	b := []Person{christina, dolores}

	matches := match.GaleShapley(a, b)
	fmt.Println(matches) // "Alex" --> "Dolores", "Bradley" --> "Christina"
}

About

Matching algorithms, currently implements Gale-Shapley proposal alg


Languages

Language:Go 100.0%