Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build requirements in pyproject.toml #10

Open
wants to merge 5 commits into
base: lkh-3
Choose a base branch
from

Conversation

ludwigschwardt
Copy link

This allows pip to pick up and install scikit-build before running setup.py, thereby avoiding the "No module named 'skbuild'" error. Also include the wheel package, needed to build wheels.

This should allow pip to build elkai 0.1.2 from source from PyPI for systems without prebuilt wheels (once the source distribution is uploaded 🙂).

This allows pip to pick up and install scikit-build before running
setup.py, thereby avoiding the "No module named 'skbuild'" error.

Also include the wheel package, needed to build wheels.
@fikisipi
Copy link
Owner

fikisipi commented Mar 18, 2023

[I hereby commit to uploading a sdist and taking a look at this tomorrow or Monday]

@ludwigschwardt
Copy link
Author

Great, thanks!

@fikisipi fikisipi changed the base branch from master to lkh-3 March 20, 2023 22:23
@fikisipi
Copy link
Owner

fikisipi commented Mar 20, 2023

I managed to get pyproject.toml up and running on a new branch - it works well!

Now I decided to fully port the new LKH version: from 2.0.9 to 3.0.8 and I'm fixing some linker stuff. The lkh-3 branch isn't stable yet, but can you try checking it out, pip install . and try to solve a matrix?

@ludwigschwardt
Copy link
Author

ludwigschwardt commented Mar 24, 2023

Thanks for this!

I compared v0.1.2 and v0.1.3 on a small dataset containing 200 random 2-D point, i.e. the distance matrix has dimensions 200 x 200. By the way, 0.1.3 seems like a very minor change for a package that had a major version bump on its internal library :-)

Both found the same path:

elkai_0 1 2

I was curious about that bit on the lower left where the path crosses itself, which seems suboptimal, but that could just be poor intuition on my side...

I then tried to time both, since the new one seemed faster. v0.1.2 took 4.6 seconds, but v0.1.3 crashed when I ran it twice on the same data:

>>> elkai.solve_float_matrix(dist)
[0, 119, 106, 130, 31, 26, 127, 25, 159, 22, 27, 141, 181, 195, 20, 176, 29, 132, 149, 33, 24, 28, 14, 37, 83, 138, 151, 62, 21, 186, 150, 122, 87, 93, 146, 137, 182, 175, 114, 74, 23, 53, 100, 51, 32, 52, 111, 169, 193, 116, 94, 68, 177, 110, 40, 66, 75, 92, 183, 35, 99, 168, 188, 179, 78, 89, 108, 113, 196, 98, 4, 194, 180, 10, 15, 46, 139, 144, 12, 101, 154, 64, 63, 47, 73, 166, 82, 164, 112, 185, 189, 173, 162, 104, 60, 54, 65, 155, 191, 161, 13, 107, 69, 136, 9, 115, 55, 6, 128, 174, 91, 125, 148, 192, 126, 129, 152, 157, 147, 105, 170, 59, 71, 158, 153, 19, 118, 16, 36, 156, 43, 48, 172, 96, 135, 70, 77, 178, 85, 102, 97, 81, 7, 199, 123, 38, 72, 133, 171, 143, 145, 58, 30, 142, 8, 95, 3, 49, 34, 50, 120, 86, 80, 167, 1, 187, 190, 39, 61, 44, 163, 18, 134, 121, 109, 88, 56, 42, 11, 140, 84, 198, 2, 41, 5, 90, 131, 79, 117, 17, 67, 103, 45, 160, 184, 76, 57, 165, 197, 124]
>>> elkai.solve_float_matrix(dist)
python(16514,0x112138e00) malloc: *** error for object 0x7fcc114d7ea0: pointer being realloc'd was not allocated
python(16514,0x112138e00) malloc: *** set a breakpoint in malloc_error_break to debug
Abort trap: 6

Elkai 0.1.2 does not have this issue (built on macOS 11.7.3, Python 3.10, scikit-build 0.16.7).

@fikisipi
Copy link
Owner

fikisipi commented Mar 24, 2023

I will probably do a major version bump! The branch and the PR don't mention an explicit elkai version - even though I did increment the patch version. Should we do 1.0.0?

Thanks for the bug report, memory issues are part of the pending PR. I'm almost certain that multiple calls to solve will leak, but also free extra memory.

I'm also planning on adding a patch file instead of committing to the LKH folder (that removes their printfs and some allocations) so that the LKH folder stays true to upstream.

@fikisipi fikisipi force-pushed the lkh-3 branch 2 times, most recently from 12d8812 to fbb29ea Compare April 19, 2023 12:47
@fikisipi
Copy link
Owner

fikisipi commented Jul 2, 2023

@ludwigschwardt Have you tried the new elkai?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants