Skip to content
This repository was archived by the owner on Jan 24, 2026. It is now read-only.
This repository was archived by the owner on Jan 24, 2026. It is now read-only.

An alternative to the "return_indices" parameter #4

@erelsgl

Description

@erelsgl

Most functions now have a boolean "return_indices" flag. As an alternative, and to simplify the interface, I suggest that the returned PartitioningResult object always contains the indices, and a pointer to the actual values. The object will have two methods: one to return the indices, and one to compute and return the values. This will simplify the functions, and move the decision of output format to the output object. For example:

result = greedy([11,22,33,44], 2)
print(result.indices())
print(result.values())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions