Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

how to declare demands ?

Open
#75 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp, javascript, node.js
Domain
api, documentation

Research direction

Start with the documentation's description of demands and the vrpSolverOpts example, especially its demands array. Clarify how each value maps to a location and add a worked example for the five delivery locations and vehicle capacities described in the issue.

Written by the indexing model from the issue text.

Description

Hello, i'm really confused about how to declare demands, in the documentation it states that there is a from-to locations pair of values, and in this example i see 3 values inside a single array, i'm confused which one is which:

var vrpSolverOpts = { numNodes: 3, costs: [[0, 10, 10], [10, 0, 10], [10, 10, 0]], durations: [[0, 2, 2], [2, 0, 2], [2, 2, 0]], timeWindows: [[0, 9], [2, 3], [2, 3]], demands: [[0, 0, 0], [1, 1, 1], [1, 1, 1]] };

Let's say i have 3 vehicles with capacity of 15 each.
All goods are loaded from the depot.
and 5 locations to deliver to with the following demands :
location A demands 5
location B demands 3
location C demands 2
location D demands 7
location E demands 10

How can I specify the demands in such case ?
Thank you.

Dominant language
C++
Stars
155
Forks
47
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mapbox/node-or-tools

All issues in mapbox/node-or-tools

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.