Each company must be struggling to fight against new coronavirus infections.
The goal was stated to reduce contact with people by 80%. Having said that, I don’t think you can cut your work by 80%.
I try to figure out how I can stay as productive as I have been by not meeting with people as much as possible.
This time, it’s the knapsack problem that we’re going to use for that. The knapsack problem is a problem like “I want to fill a limited size knapsack with things that are as valuable to me as possible. Here’s the thing.
We will try to make it a problem of However, if you cram in too much work that you can do without meeting too many people, you will become overworked, so you will aim to work as much as you have in terms of productivity. Not only does this prevent overwork, but it also eliminates the awkward “inequality constraint” when solving problems with quantum annealing, making the calculations more stable.
Let’s pick up on the traditional way of working.
Let’s write it out in the form of
(job description (str), number of contacts (int), productivity (int)).
works = [ ('Regular Meeting', 6, 4), ('Project meeting', 7, 4), ('Business trip for a meeting', 25, 6), ('Holding a study session', 50, 10), ('Usual Development', 4, 10), ('Customer visit', 8, 6), ]
Let's say the above is the flow of a day's work. How many people are you in contact with on a regular basis and how productive are you?
productivity = sum(map(lambda w: w, works)) persons = sum(map(lambda w: w, works)) print('Number of contact:', persons) print(('👦👧🧑👨'*persons)[:persons]) print('Productivity:', productivity) print(('📧💰📈📝'*productivity)[:productivity])
Number of contact: 100 👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨👦👧🧑👨 Productivity: 40 📧💰📈📝📧💰📈📝📧💰📈📝📧💰📈📝📧💰📈📝📧💰📈📝📧💰📈📝📧💰📈📝📧💰📈📝📧💰📈📝
Now, here’s an idea of what it looks like to work without interacting with people.
works += [ ('Online meetings using ZOOM', 0, 3), ('Online meetings using WebEx', 0, 3), ('Online meetings using Google Hangout', 0, 3), ('Online meetings using Skype', 0, 3), ('Internal information sharing using Slack, etc.', 0, 4), ('Hosting a webiner using YouTube', 1, 9), ('Examining operational efficiencies and strategies', 0, 2), ('Partially introducing remote work', 2, 6), ('Sales with Internet and E-mail', 0, 5), ]
Now, let’s move on to the optimization.
We’re going to create a way of working that keeps us productive and reduces meeting people as much as possible.
from pyqubo import Array, Constraint, solve_qubo q = Array.create('q', shape=len(works), vartype='BINARY') Hconstraint = Constraint((sum(w * q_ for w, q_ in zip(works, q)) - productivity)**2, 'productivity') Hobjective = sum(w * q_ for w, q_ in zip(works, q)) H = (Hobjective + 2*Hconstraint)*0.1 model = H.compile() qubo, offset = model.to_qubo() import dimod from dwave.system.samplers import LeapHybridSampler bqm = dimod.BQM.from_qubo(qubo)
#solution = solve_qubo(qubo) import re token = "token here" while 1: sampler = LeapHybridSampler(token=token) result = sampler.sample(bqm) solution = result.first.sample solution = dict(sorted(solution.items(), key=lambda kv: int(re.search('[0-9]+', kv)))) new_works = [w for v, w in zip(solution.values(), works) if v] new_productivity = sum(map(lambda w: w, new_works)) new_persons = sum(map(lambda w: w, new_works)) if productivity <= new_productivity < productivity + 5 and new_persons <= persons * 0.2: break new_works
[('Usual Development', 4, 10), ('Online meetings using ZOOM', 0, 3), ('Online meetings using WebEx', 0, 3), ('Online meetings using Google Hangout', 0, 3), ('Online meetings using Skype', 0, 3), ('Internal information sharing using Slack, etc.', 0, 4), ('Hosting a webiner using YouTube', 1, 9), ('Sales with Internet and E-mail', 0, 5)]
print('Number of contact:', new_persons) print(('👦👧🧑👨'*new_persons)[:new_persons]) print('Productivity:', new_productivity) print(('📧💰📈📝'*new_productivity)[:new_productivity])
Number of contact: 5 👦👧🧑👨👦 Productivity: 40 📧💰📈📝📧💰📈📝📧💰📈📝📧💰📈📝📧💰📈📝📧💰📈📝📧💰📈📝📧💰📈📝📧💰📈📝📧💰📈📝
We have been able to significantly reduce the number of people in contact with us while maintaining our productivity.
At MDR, we had originally incorporated remote work, but we still had meetings with people. These days it’s mostly online meetings. Depending on the industry, remote work may be difficult, but I hope to maintain productivity while avoiding unnecessary contact with others.