Project title:
P-median location problem in python
Posted by:
External project from PeoplePerHour
Started:
05-May-2021 16:43 GMT
Description:
I have a formulation, and I need to edit it. Could you please help me with it? by removing the warehouses : from __future__ import print_function import sys from ortools.constraint_solver import pywrapcp def main(): # Create the solver. solver = pywrapcp.Solver('P-median problem') # # data # p = 2 num_customers = 4 customers = list(range(num_customers)) Albert, Bob, Chris, Daniel = customers num_warehouses = 3 warehouses = list(range(num_warehouses)) Santa_Clara, San_Jose, Berkeley = warehouses demand = [100, 80, 80, 70] distance = [[2, 10, 50], [2, 10, 52], [50, 60, 3], [40, 60, 1]] # # declare variables # open = [solver.IntVar(warehouses, 'open[%i]% % i') for w in warehouses] ship = {} for c in customers: for w in warehouses: ship[c, w] = solver.IntVar(0, 1, 'ship[%i,%i]' % (c, w)) ship_flat = [ship[c, w] for c in customers for w in warehouses] z = solver.IntVar(0, 1000, 'z') # # constraints # z_sum = solver.Sum([ demand[c] * distance[c][w] * ship[c, w] for c in customers for w in warehouses ]) solver.Add(z == z_sum) for c in customers: s = solver.Sum([ship[c, w] for w in warehouses]) solver.Add(s == 1) solver.Add(solver.Sum(open) == p) for c in customers: for w in warehouses: solver.Add(ship[c, w]
Project ID:
3167292
Project category:
Project budget:
Project
Started
PrestaShop 1.6 Feature Enhancement
Category : ECommerce, HTML, MySQL, PHP, Prestashop Budget : €8 - €30 EUR
13-May-2024 22:04 GMT
Quick Minimalist Logo for Branding
Category : Graphic Design, Illustration, Logo Design, Photoshop Budget : £10 - £20 GBP
13-May-2024 22:03 GMT
Figma Design to Fully Functional Website
Category : HTML, PHP, SEO, Web Design, WordPress Budget : £250 - £750 GBP
13-May-2024 22:02 GMT
Hosting Solution for Node.js/MongoDB WebApp
Category : JavaScript, MongoDB, Node.js, NoSQL Couch & Mongo, Web Hosting Budget : $10 - $30 USD
13-May-2024 22:02 GMT
Minimalistic Logo for Tech Trading
Category : Photoshop Design, PHP, T Shirts, Web Design Budget : $2 - $8 USD
13-May-2024 22:00 GMT
Keycloak Software Developer with .NET
Category : .NET, C#, Programming, Software Architecture Budget : $250 - $750 USD
13-May-2024 22:00 GMT
Full-stack Developer for Social Network Site
Category : CSS, HTML, JavaScript, PHP, React.js Budget : €3000 - €5000 EUR
13-May-2024 22:00 GMT
Shopify Store Creation for Physical Products - Criação de loja Shopify para produtos físicos
Category : ECommerce, Graphic Design, HTML, PHP, Web Design Budget : €2 - €50 EUR
13-May-2024 22:00 GMT
Vibrant, Private, Financial Data Handling iOS App
Category : IPad, IPhone, Mobile App Development, Objective C, Swift Budget : ₹600 - ₹1500 INR
13-May-2024 22:00 GMT
Business Website for Product Showcase
Category : Graphic Design, HTML, PHP, Web Design, WordPress Budget : $30 - $250 USD
13-May-2024 21:59 GMT
Decentralized App Development on Binance Smart Chain
Category : Binance Smart Chain, Blockchain, Ethereum, Web Development, Web3.js Budget : $25 - $50 USD
13-May-2024 21:56 GMT
Infused Water Bottle Design
Category : Brochure Design, Corporate Identity, Covers & Packaging, Graphic Design, Logo Design Budget : $30 - $250 USD
13-May-2024 21:56 GMT
necesito narrador para mi canal de youtube
Category : Audio Services, Audiobook Narration Budget : €6 - €12 EUR
13-May-2024 21:56 GMT
Scientific Research Assistant Needed with Expertise in ML/DL
Category : Data Science, Deep Learning, Machine Learning (ML), Research Writing, Scientific Research Budget : ₹1500 - ₹12500 INR
13-May-2024 21:56 GMT
Provide a title plan for submission to the land registry
13-May-2024 20:35 GMT
Browse All Projects