1 of 28

We Knit Hats LLC

John Brown

Anna Green

Corpbiz INC

Susie Brown

Betty Green

Arbor High School

James Brown

Astra Green

1234 S. Main St.

800 Arbor Rd. Unit 4

“work/school”

“home”

basic idea:

  • “people” tiles and “place” tiles
    • “place” tiles as communication helpers
  • “home” along columns
  • “work/school” along rows

2 of 28

“work/school”

“home”

  1. gather phase

(get sample pathogen from member tiles to “place” tile)

3 of 28

“work/school”

“home”

2. broadcast phase�(get sample pathogen(s) from “place” tiles out to member tiles)

4 of 28

Megacorp

Inc

Candice Brown

(Ralph’s Butcher Shop)

(Ralph Butcher Jr.)

Sandwich

Shop

Judy Brown

(Ralph Butcher)

Alastair Blue

Howie Hubert

(Frankie Butcher)

Arbor High

Suzie Brown

(200 N. Main)

100 Arborview

1234 S. Main St

400 Arborview

~20 “colors” to play with (maybe up to 25) — problem: how to lay out????

5 of 28

Megacorp

Inc

Candice Brown

(Ralph’s Butcher Shop)

(Ralph Butcher Jr.)

Sandwich

Shop

Judy Brown

(Ralph Butcher)

Alastair Blue

Howie Hubert

(Frankie Butcher)

Arbor High

Suzie Brown

(200 N. Main)

100 Arborview

1234 S. Main St

400 Arborview

~20 “colors” to play with (maybe up to 25) — how to lay out????

“pass thru”

Ralph Butcher

6 of 28

Megacorp

Inc

Candice Brown

(Ralph’s Butcher Shop)

(Ralph Butcher Jr.)

Sandwich

Shop

Judy Brown

(Ralph Butcher)

Alastair Blue

Howie Hubert

(Frankie Butcher)

Arbor High

Suzie Brown

(200 N. Main)

100 Arborview

1234 S. Main St

400 Arborview

elaboration: maybe add something like “chance encounters”?

7 of 28

Problems

  1. compile time might be high
  2. under low case count, wafer is poorly utilized
  3. restrictive social model
  4. solving for layout will be hard
  5. potentially coarse home/workplace transmission model (one or a few strains gathered and broadcast)

8 of 28

Layout Problem Specifications

9 of 28

993

0

749

X direction

Y

direction

WSE Geometry

(745,500 “tiles”)

10 of 28

Validation Criteria Details

  • People and Places
    • Places are either a residence (i.e., home) or an institution (e.g., work, school).
    • Every residence must have 2 to 10 people; every institution must have 2 to 100 people.
    • Every person must be a member of exactly one residence and exactly one institution.
  • Tiles
    • 2D grid: NCOL=750 (x dimension), NROW=994 (y dimension)
    • Every residence must have exactly one “place” tile.
    • Every institution must have exactly one “place” tile.
    • Every person must have exactly one “person” tile.
    • Every tile must contain exactly one place or exactly one person. (i.e., exactly one “object” per tile; all tiles filled)
  • “Streaks”
    • We will want residences along the rows & institutions along columns (note: opposite of diagrams).
    • All people tiles in an institution must be inside a contiguous vertical upwards (i.e., northwards) “streak” from an intuition’s place tile.
      • (but the streak also may contain other places or people in other institutions).
    • All people tiles in a residence must be inside a contiguous horizontal rightwards (i.e., eastwards) “streakfrom a residence’s place tile.
      • (but the streak also may contain other places or people in other residences).
    • Streaks begin at a place tile and end at the last person tile in that place (inclusive).
  • Colors
    • Assume 20 colors.
    • Each institution is assigned a single color. Each residence is assigned a single color.
    • Two or more institutions may share the same color. Two or more residences may share the same color.
    • For simplicity (starting out), use a color either for residences OR for institutions (not for a mix of both).
      • For example, colors 0-9 for residences and colors 10-19 for institutions
    • No “streaks” with the same color may overlap on the tile grid.
  • Social network interpretation.
    • “Places” are nodes and “people” are edges. Two places with same person are connected by an edge.
    • Requirement: graph must be globally connected (optional, but higher priority than optimization below).
  • Optimization.
    • (optional) Try to minimize excess “streak” lengths (i.e., tiles other than members of that place in a place streak).
    • (optional) Try to approximate graph structure of “real-world” social networks (e.g., like covasim-generated).

11 of 28

Suggested Output Format

residence table

tile_x

tile_y

color

tile_type

place_id

[0-749]

[0-993]

[0-19]

[person,place]

uint

institution table

tile_x

tile_y

color

tile_type

place_id

[0-749]

[0-993]

[0-19]

[person,place]

uint

“combined” table

tile_x

tile_y

color

tile_type

place_id

place_type

[0-749]

[0-993]

[0-19]

[person,place]

uint

[institution,residence]

each entry is:

  • a residence place
  • OR a person in a residence

each entry is:

  • an institution place
  • OR a person in an institution

each entry is:

  • an entry from residence table
  • OR an entry from institution table

12 of 28

Suggested Validation Format

Should be created from output-format table (entries from that table plus new “bypass” entries)

tile_x

tile_y

color

tile_type

place_id

place_type

[0-749]

[0-993]

[0-19]

[person,place,bypass]

uint

[institution,residence]

Every tile in every streak should have one entry in this table.

  • Bypass”: tiles in a place streak that are not that place’s people.
    • i.e., other places or people not in that place

Example validation rules (more may be needed in addition to these):

  • No “tile_x/tile_y/color” combination should appear more than once.
  • No “tile_x/tile_y/place_type/place_id” combination should appear more than once.
  • Every possible “tile_x/tile_y” combination should appear at least once.
  • All entries with same “place_id” must have same “color.”
  • Among “institution” entries, same “place_id” must have same “tile_x.”
  • Among “residence” entries, same “place_id” must have same “tile_y.”

13 of 28

Suggested Work Plan (overview)

  1. Manually write an example “validation format” table
  2. Create Jupyter notebook to visualize “validation format” table
  3. Write/test validator function to check “validation format” table
  4. Write/test “output-” -> “validation-format” converter function
  5. Work by example to develop iterative tile-filling procedure to build random valid configurations.
  6. Write/test tile-filling procedure function.
  7. Write/test graph extraction function to get social network graph from output-format data.
  8. Analyze social network graphs from tile-filling procedure function.
    1. Global connectivity?
    2. Plausible graph structure compared to “real-world” social networks
  9. Tweak/optimize tile-filling procedure function
    • Improve structure of created graph (see point 8)
    • Reduce “excess streak length” on tile grid
  10. Possible extension: try to create tile layout for “real-world” social network

14 of 28

Detailed Work Plan (Stage 1)

  • Manually write small (8x8) “good” validation format table in excel, save to CSV.
    • @emily: any library suggestions for this?
  • Code simple visualizers for validation format data.
    • Use Jupyter notebook.
    • These can be ugly/rough!!
    • Run with good CSV input.
  • Write validator function for validation format data.
    • Input: Pandas dataframe (validation format data)
    • Output: boolean pass/fail
    • Print: fail reason
    • Note: ignore global connectivity requirement to start out with
  • Test validator function.
    • List possible validator fail reasons.
    • Create an example “bad” table in excel for each fail reason.
    • Ensure validator passes “good” data and fails “bad” data.
    • Put code and CSVs in a git project and use pytest.
  • Using excel, manually convert “good” validation format table to “output” format table. Save to CSV.
  • Write output-to-validation conversion function.
    • Input: Pandas dataframe (output format data)
    • Output: Pandas dataframe (validation format data)
    • may raise ValueError if input data is invalid
  • Test output-to-validation conversion function.
    • Put code and CSVs in the git project and use pytest.
    • Ensure converter creates original “good” validation format table from manually written output-format table.
    • May have to sort rows before comparing tables.
    • Manually create possible “bad” output-format tables in excel. Save to CSV.
    • Run “bad output-format CSV” -> converter func -> validator func
      • Ensure result is False or exception raised

🏬

🏬

👤

🏬

👤

👤

👤

👤

👤

Color 0

🏠

🏠

👤

👤

Color 1

🏬

🏠

🏬

👤

🏬

👤

👤

👤

👤

🏠

👤

👤

Tile type

(don’t include bypass ⏩)

suggested visualizations:

(give each place a randomly-assigned hue)

15 of 28

Detailed Work Plan (Stage 2)

  • Outline an iterative “tile-filling” procedure to build an arbitrary valid configuration.
    • At each step, some combination of place(s) and people added; continue until grid is filled.
    • Suggestion:
      • Use a whiteboard or excel to build several example grids manually.
      • Try to write down a rough set of rules about how you are building the grids.
      • Try building grids on whiteboard or in excel using your rules; refine rules as needed.
      • Continue until rules are well-defined.
  • Write your “tile-filling” procedure as a function.
    • Input: grid NCOL, grid NROW
      • If using random choices, also input seed for random number generator
    • Output: Pandas dataframe (output format data)
  • Test the “tile-filling” procedure.
    • Put code and CSVs in the git project and use pytest.
    • Run with several grid size inputs (from small to full size).
    • Ensure: “Tile-filling” procedure -> output format -> converter func -> validator func -> True

16 of 28

Detailed Work Plan (Stage 3)

  • Write function to extract social network graph from output format data.
    • Input: pandas dataframe (output format data)
    • Output: graph representation of social network (e.g., NetworkX or similar)
      • First create “edges are people/nodes are places” then create “nodes are people/edges are interactions”
    • Do conversion for “small” 8x8 graph manually; use pytest to test extraction function gives manual result.
  • Create Jupyter notebook to analyze graph structure generated using tile-filling procedure function.
    • Run tile-filling procedure func -> graph extraction func -> graph representation
    • Test for global connectivity
    • Compare graph metrics and visualizations with real social network graphs and/or social network graphs generated e.g., using CovaSim.
  • Refine tile-filling procedure function.
    • Top priority: ensure global connectivity.
    • Second priority: tune graph structure to resemble plausible social network

17 of 28

Possible Extensions (Stage 4)

  • Measure excess “streak” lengths
    • i.e., tiles other than members of that place in a place streak
    • Will need to write/test measurement func that measures streak length for output-format pandas DataFrame.
    • Will need to write/test func to calculate best-possible streak lengths (i.e., subtracting out “bypasses”) for output-format pandas DataFrame.
  • Optimize to reduce excess “streak” lengths
    • Possible strategies:
      • Tweak and revine tile-filling procedure function.
      • Might create function to look for improvements by rearranging a given tile grid layout
  • Try to create function to lay out a given social network onto the WSE tile grid.
    • Will first need to convert social network where nodes are people and edges are interactions to place network where nodes are places and edges are people.
    • And then create layout for place network.
    • Starting point: do a best-effort try, and return None if generated tile grid result isn’t valid.
    • Focus on a few real or synthetic social networks of interest, rather than solving the general case.

18 of 28

Prototype Code

19 of 28

Place

Person

Person

Person

send.csl

empty.csl

empty.csl

recv.csl

W

E

R

E

R

M0

M0

M0

M0

W

E

R

W

E

R

W

R

async send

async

recv

async

recv

async

recv

note: async recvs are for genome size + 1, and so are terminated by upcoming control wavelet

sample genome distributed from place to people

20 of 28

Place

Person

Person

Person

send.csl

empty.csl

empty.csl

recv.csl

W

E

R

E

R

M0

M0

M0

M0

W

E

R

W

E

R

W

R

place sends control wavelet

  • advances all person routers
  • activates `on_control` recv callback in all person PEs

SWITCH_ADV

ignore_ce=false

21 of 28

Place

Person

Person

Person

send.csl

empty.csl

empty.csl

recv.csl

W

E

R

E

R

M1

M1

M1

M1

W

W

E

R

W

R

R

in callback from control wavelet,

  • recv.csl tiles launch async send
  • empty.csl tiles
    • set `POP_ON_ADVANCE` (!!! is this a race condition??)
    • sync recv for one wavelet (is this control wavelet???)
    • start never-filled async recv to “wait” for control callback

async send

big async

recv

22 of 28

Place

Person

Person

Person

send.csl

empty.csl

empty.csl

recv.csl

W

E

R

E

R

M1

M1

M1

M1

W

W

E

R

W

R

R

big async

recv

SWITCH_ADV

ignore_ce=true

pop

recv.csl sends control wavelet

  • advances next Person router
  • opcode popped, so no further effects

23 of 28

Place

Person

Person

Person

send.csl

empty.csl

empty.csl

recv.csl

W

E

R

E

R

M1

M1

M2

M1

W

W

E

R

W

R

R

big async

recv

SWITCH_ADV

ignore_ce=false

recv.csl sends a second control wavelet

  • advances next Person router again
  • enters CE to interrupt “wait” async recv in next Person

24 of 28

Place

Person

Person

Person

send.csl

empty.csl

empty.csl

recv.csl

W

E

R

E

R

M1

M1

M3

M1

W

W

E

R

W

R

R

big async

recv

empty.csl starts async send to Place

async send

25 of 28

Place

Person

Person

Person

send.csl

empty.csl

empty.csl

recv.csl

W

E

R

E

R

M1

M1

M3

M1

W

W

E

R

W

R

R

big async

recv

empty.csl sends control wavelet

  • advances next Person router
  • opcode popped, so no further effects

SWITCH_ADV

ignore_ce=true

pop

26 of 28

Place

Person

Person

Person

send.csl

empty.csl

empty.csl

recv.csl

W

E

R

E

R

M1

M2

M3

M1

W

W

E

R

W

R

R

big async

recv

empty.csl sends a second control wavelet

  • advances next Person router again
  • enters CE to interrupt “wait” async recv in next Person

SWITCH_ADV

ignore_ce=false

27 of 28

Place

Person

Person

Person

send.csl

empty.csl

empty.csl

recv.csl

W

E

R

E

R

M1

M3

M3

M1

W

W

E

R

W

R

R

big async

recv

async send

empty.csl starts async send to Place

28 of 28

Place

Person

Person

Person

send.csl

empty.csl

empty.csl

recv.csl

W

E

R

E

R

M1

M3

M3

M1

W

W

E

R

W

R

R

Fin!

(as final step, tiles have reset routers

to to M0… Place starts async send and Persons start async recv and cycle repeats)