• About TC
  • Affiliate Disclaimer
  • Privacy Policy
  • TOS
  • Contact
Thursday, June 12, 2025
Techcratic
  • TC
  • AI
    Artificial Intelligence

    Amazon Nova Lite enables Bito to offer a free tier option for its AI-powered code reviews

    Artificial Intelligence

    Bridging the Gap: New Datasets Push Recommender Research Toward Real-World Scale

    Artificial Intelligence

    7 Python Errors That Are Actually Features

    Artificial Intelligence

    10 Awesome OCR Models for 2025

    Artificial Intelligence

    5 Error Handling Patterns in Python (Beyond Try-Except)

    Artificial Intelligence

    Top 5 Alternative Data Career Paths and How to Learn Them for Free

    Artificial Intelligence

    Implementing Machine Learning Pipelines with Apache Spark

    Artificial Intelligence

    Learn Power BI for Free This Week

    Artificial Intelligence

    Build GraphRAG applications using Amazon Bedrock Knowledge Bases

  • Crypto
    Bitcoin Tumbles Below $106K as $645M in Liquidations Rattle Crypto Markets

    Bitcoin Tumbles Below $106K as $645M in Liquidations Rattle Crypto Markets

    Ether ETFs Hit Historic 18th Consecutive Day of Gains With $240 Million Inflow

    Ether ETFs Hit Historic 18th Consecutive Day of Gains With $240 Million Inflow

    Solana Set to Reclaim $200? PumpSwap’s $2.5B Launch Puts DEX Fuel Behind SOL

    Ripple CEO Garlinghouse Says XRP Could Power $21 Trillion in SWIFT Transfers – $1,000 XRP Possible?

    ECB Confirms Gold Dethroned the Euro as the Second Reserve Asset

    ECB Confirms Gold Dethroned the Euro as the Second Reserve Asset

    Binance Expands Access to Syrian Residents Following Suspension of US Sanctions

    Binance Expands Access to Syrian Residents Following Suspension of US Sanctions

    Brazilian Party Proposes Bill to Restrict Bitcoin Mining and Tax Trading Activities

    Brazilian Party Proposes Bill to Restrict Bitcoin Mining and Tax Trading Activities

    Crypto to “Become Part of All Sectors” Under Trump: Kevin O’Leary

    Syrians to Gain Full Access to Binance Products, Services

    This Solana Startup Wants to Reward You for Being Healthy

    This Solana Startup Wants to Reward You for Being Healthy

    Bitcoin Bull Cycle is Over: CryptoQuant CEO

    Singapore License Threat Prompts Bitget, Bybit to Plan Exit

  • Cybersecurity
    Cybersecurity

    AI Agents Run on Secret Accounts — Learn How to Secure Them in This Webinar

    Cybersecurity

    How to Address the Expanding Security Risk

    Cybersecurity

    ConnectWise to Rotate ScreenConnect Code Signing Certificates Due to Security Risks

    Cybersecurity

    5 Lessons from River Island

    Cybersecurity

    INTERPOL Dismantles 20,000+ Malicious IPs Linked to 69 Malware Variants in Operation Secure

    Cybersecurity

    SinoTrack GPS Devices Vulnerable to Remote Vehicle Control via Default Passwords

    Cybersecurity

    Researchers Uncover 20+ Configuration Risks, Including Five CVEs, in Salesforce Industry Cloud

    Cybersecurity

    Adobe Releases Patch Fixing 254 Vulnerabilities, Closing High-Severity Security Gaps

    Cybersecurity

    Researcher Found Flaw to Discover Phone Numbers Linked to Any Google Account

  • Deals
    Replacement-Voice-Remote-Control-for-Insignia-Toshiba-Pioneer-Smart-TVs

    Replacement-Voice-Remote-Control-for-Insignia-Toshiba-Pioneer-Smart-TVs

    Microphone Mic 2.5mm Compatible for Pioneer DMH-1500NEX, MVH1400NEX, AVH-1400NEX,…

    Microphone Mic 2.5mm Compatible for Pioneer DMH-1500NEX, MVH1400NEX, AVH-1400NEX,…

    Lenovo ThinkCentre Business All-in-one Computer, 23.8″ FHD IPS Display, 13th Gen Intel…

    Lenovo ThinkCentre Business All-in-one Computer, 23.8″ FHD IPS Display, 13th Gen Intel…

    HyperX SoloCast USB Condenser Microphone Tap-to-Mute Sensor Card for Gaming Streaming…

    HyperX SoloCast USB Condenser Microphone Tap-to-Mute Sensor Card for Gaming Streaming…

    Mini PC P4 Plus, AMD Ryzen 7 5825U Mini Computers, 32GB DDR4 RAM 1TB m.2 NVMe SSD, Dual…

    Mini PC P4 Plus, AMD Ryzen 7 5825U Mini Computers, 32GB DDR4 RAM 1TB m.2 NVMe SSD, Dual…

    Hitachi 319706 Cutter Set for the Hitachi VB16Y Rebar Cutter and Bender, 1-Pair

    Hitachi 319706 Cutter Set for the Hitachi VB16Y Rebar Cutter and Bender, 1-Pair

    G-Technology 1TB G-DRIVE Mobile Micro-USB 3.0 External Hard Drive (Black)

    G-Technology 1TB G-DRIVE Mobile Micro-USB 3.0 External Hard Drive (Black)

    ASRock B550M PRO4 Supports 3rd Gen AMD AM4 Ryzen / Future AMD Ryzen Processors…

    ASRock B550M PRO4 Supports 3rd Gen AMD AM4 Ryzen / Future AMD Ryzen Processors…

    acer Aspire Premium Laptop | AMD Ryzen 7 5700U (Beats i7-1250U) CPU | 64GB RAM | 2TB SSD…

    acer Aspire Premium Laptop | AMD Ryzen 7 5700U (Beats i7-1250U) CPU | 64GB RAM | 2TB SSD…

  • Gaming
    Stormgate trailer and developer interview (PC Gaming Show 2022)

    Stormgate trailer and developer interview (PC Gaming Show 2022)

    NVIDIA DRIVE Full-Stack Autonomous Vehicle Software Rolls Out

    NVIDIA DRIVE Full-Stack Autonomous Vehicle Software Rolls Out

    Siren Head Field – Walkthrough Gameplay (DAY 1 & DAY 2)

    Siren Head Field – Walkthrough Gameplay (DAY 1 & DAY 2)

    Sifu Review

    Sifu Review

    FAR CRY 5 (Honest Game Trailers)

    FAR CRY 5 (Honest Game Trailers)

    Snail BoB 2! – FULL WALKTHROUGH – HD

    Snail BoB 2! – FULL WALKTHROUGH – HD

    Dorfromantik Board Game Review I Award Winning Game

    Dorfromantik Board Game Review I Award Winning Game

    Honest Game Trailers | Fall Guys: Ultimate Knockout

    Honest Game Trailers | Fall Guys: Ultimate Knockout

    ‘I don’t actually play horror games’: Phasmophobia’s lead developer had no intention of making a horror game but still kicked off a whole new genre

    ‘I don’t actually play horror games’: Phasmophobia’s lead developer had no intention of making a horror game but still kicked off a whole new genre

  • Tesla
    Weize New 2025 Tesla Model Y Juniper Floor Mats and Cargo Liners 5-Seat All Weather…

    Weize New 2025 Tesla Model Y Juniper Floor Mats and Cargo Liners 5-Seat All Weather…

    EcoNour Foldable Spring RV Windshield Sunshade, Reflective 240T Polyster Keeps Your RV…

    EcoNour Foldable Spring RV Windshield Sunshade, Reflective 240T Polyster Keeps Your RV…

    AIDEA Microfiber Cleaning Cloth, 100PK, Soft Absorbent Rags, Microfiber Towels for Cars,…

    AIDEA Microfiber Cleaning Cloth, 100PK, Soft Absorbent Rags, Microfiber Towels for Cars,…

    BMZX Car Trash Can Trash Bin, Accessories for Interior Mini Garbage Can, Car Door Trash…

    BMZX Car Trash Can Trash Bin, Accessories for Interior Mini Garbage Can, Car Door Trash…

    Young 200 lbs. 2 Bike Rack Hitch Mount Platform Style for Cars Trucks SUVs Minivans,…

    Young 200 lbs. 2 Bike Rack Hitch Mount Platform Style for Cars Trucks SUVs Minivans,…

    Tesla Full Self-Driving hasn’t improved all year and Musk points to more wait

    1 Pack for Tesla Key Card Protective Cover with AirTag Slot, Silicone Key Card…

    1 Pack for Tesla Key Card Protective Cover with AirTag Slot, Silicone Key Card…

    Dashboard Mobile Phone Holder, Non-Slip 360 Degree Rotatable Navigation Bracket,…

    Dashboard Mobile Phone Holder, Non-Slip 360 Degree Rotatable Navigation Bracket,…

    Skechers Car Floor Mats,Heavy Duty Rubber Car Mats Full Set,All WeatherFloor…

    Skechers Car Floor Mats,Heavy Duty Rubber Car Mats Full Set,All WeatherFloor…

  • UFO
    Mind Blowing Astral Plane Encounters!

    Mind Blowing Astral Plane Encounters!

    Extraterrestrial Secrets Unearthed In Antarctica…. #podcast #earth #fact #alien #theory

    Extraterrestrial Secrets Unearthed In Antarctica…. #podcast #earth #fact #alien #theory

    Alien Uprising

    Alien Uprising

    The Alien in my yard #shorts

    The Alien in my yard #shorts

    No Place to Run 2025

    No Place to Run 2025

    MW PODCAST: Roundtable …t in UFO Investigations

    MW PODCAST: Roundtable …t in UFO Investigations

    Xenonauts – Part 3 – Alien Research & Air Power

    Xenonauts – Part 3 – Alien Research & Air Power

    Ancient Aliens: TOP 4 SHOCKING ALIEN ARTIFACTS

    Ancient Aliens: TOP 4 SHOCKING ALIEN ARTIFACTS

    Roswell – The Complete Series (17-Disc Box Set)

    Roswell – The Complete Series (17-Disc Box Set)

No Result
View All Result
  • TC
  • AI
    Artificial Intelligence

    Amazon Nova Lite enables Bito to offer a free tier option for its AI-powered code reviews

    Artificial Intelligence

    Bridging the Gap: New Datasets Push Recommender Research Toward Real-World Scale

    Artificial Intelligence

    7 Python Errors That Are Actually Features

    Artificial Intelligence

    10 Awesome OCR Models for 2025

    Artificial Intelligence

    5 Error Handling Patterns in Python (Beyond Try-Except)

    Artificial Intelligence

    Top 5 Alternative Data Career Paths and How to Learn Them for Free

    Artificial Intelligence

    Implementing Machine Learning Pipelines with Apache Spark

    Artificial Intelligence

    Learn Power BI for Free This Week

    Artificial Intelligence

    Build GraphRAG applications using Amazon Bedrock Knowledge Bases

  • Crypto
    Bitcoin Tumbles Below $106K as $645M in Liquidations Rattle Crypto Markets

    Bitcoin Tumbles Below $106K as $645M in Liquidations Rattle Crypto Markets

    Ether ETFs Hit Historic 18th Consecutive Day of Gains With $240 Million Inflow

    Ether ETFs Hit Historic 18th Consecutive Day of Gains With $240 Million Inflow

    Solana Set to Reclaim $200? PumpSwap’s $2.5B Launch Puts DEX Fuel Behind SOL

    Ripple CEO Garlinghouse Says XRP Could Power $21 Trillion in SWIFT Transfers – $1,000 XRP Possible?

    ECB Confirms Gold Dethroned the Euro as the Second Reserve Asset

    ECB Confirms Gold Dethroned the Euro as the Second Reserve Asset

    Binance Expands Access to Syrian Residents Following Suspension of US Sanctions

    Binance Expands Access to Syrian Residents Following Suspension of US Sanctions

    Brazilian Party Proposes Bill to Restrict Bitcoin Mining and Tax Trading Activities

    Brazilian Party Proposes Bill to Restrict Bitcoin Mining and Tax Trading Activities

    Crypto to “Become Part of All Sectors” Under Trump: Kevin O’Leary

    Syrians to Gain Full Access to Binance Products, Services

    This Solana Startup Wants to Reward You for Being Healthy

    This Solana Startup Wants to Reward You for Being Healthy

    Bitcoin Bull Cycle is Over: CryptoQuant CEO

    Singapore License Threat Prompts Bitget, Bybit to Plan Exit

  • Cybersecurity
    Cybersecurity

    AI Agents Run on Secret Accounts — Learn How to Secure Them in This Webinar

    Cybersecurity

    How to Address the Expanding Security Risk

    Cybersecurity

    ConnectWise to Rotate ScreenConnect Code Signing Certificates Due to Security Risks

    Cybersecurity

    5 Lessons from River Island

    Cybersecurity

    INTERPOL Dismantles 20,000+ Malicious IPs Linked to 69 Malware Variants in Operation Secure

    Cybersecurity

    SinoTrack GPS Devices Vulnerable to Remote Vehicle Control via Default Passwords

    Cybersecurity

    Researchers Uncover 20+ Configuration Risks, Including Five CVEs, in Salesforce Industry Cloud

    Cybersecurity

    Adobe Releases Patch Fixing 254 Vulnerabilities, Closing High-Severity Security Gaps

    Cybersecurity

    Researcher Found Flaw to Discover Phone Numbers Linked to Any Google Account

  • Deals
    Replacement-Voice-Remote-Control-for-Insignia-Toshiba-Pioneer-Smart-TVs

    Replacement-Voice-Remote-Control-for-Insignia-Toshiba-Pioneer-Smart-TVs

    Microphone Mic 2.5mm Compatible for Pioneer DMH-1500NEX, MVH1400NEX, AVH-1400NEX,…

    Microphone Mic 2.5mm Compatible for Pioneer DMH-1500NEX, MVH1400NEX, AVH-1400NEX,…

    Lenovo ThinkCentre Business All-in-one Computer, 23.8″ FHD IPS Display, 13th Gen Intel…

    Lenovo ThinkCentre Business All-in-one Computer, 23.8″ FHD IPS Display, 13th Gen Intel…

    HyperX SoloCast USB Condenser Microphone Tap-to-Mute Sensor Card for Gaming Streaming…

    HyperX SoloCast USB Condenser Microphone Tap-to-Mute Sensor Card for Gaming Streaming…

    Mini PC P4 Plus, AMD Ryzen 7 5825U Mini Computers, 32GB DDR4 RAM 1TB m.2 NVMe SSD, Dual…

    Mini PC P4 Plus, AMD Ryzen 7 5825U Mini Computers, 32GB DDR4 RAM 1TB m.2 NVMe SSD, Dual…

    Hitachi 319706 Cutter Set for the Hitachi VB16Y Rebar Cutter and Bender, 1-Pair

    Hitachi 319706 Cutter Set for the Hitachi VB16Y Rebar Cutter and Bender, 1-Pair

    G-Technology 1TB G-DRIVE Mobile Micro-USB 3.0 External Hard Drive (Black)

    G-Technology 1TB G-DRIVE Mobile Micro-USB 3.0 External Hard Drive (Black)

    ASRock B550M PRO4 Supports 3rd Gen AMD AM4 Ryzen / Future AMD Ryzen Processors…

    ASRock B550M PRO4 Supports 3rd Gen AMD AM4 Ryzen / Future AMD Ryzen Processors…

    acer Aspire Premium Laptop | AMD Ryzen 7 5700U (Beats i7-1250U) CPU | 64GB RAM | 2TB SSD…

    acer Aspire Premium Laptop | AMD Ryzen 7 5700U (Beats i7-1250U) CPU | 64GB RAM | 2TB SSD…

  • Gaming
    Stormgate trailer and developer interview (PC Gaming Show 2022)

    Stormgate trailer and developer interview (PC Gaming Show 2022)

    NVIDIA DRIVE Full-Stack Autonomous Vehicle Software Rolls Out

    NVIDIA DRIVE Full-Stack Autonomous Vehicle Software Rolls Out

    Siren Head Field – Walkthrough Gameplay (DAY 1 & DAY 2)

    Siren Head Field – Walkthrough Gameplay (DAY 1 & DAY 2)

    Sifu Review

    Sifu Review

    FAR CRY 5 (Honest Game Trailers)

    FAR CRY 5 (Honest Game Trailers)

    Snail BoB 2! – FULL WALKTHROUGH – HD

    Snail BoB 2! – FULL WALKTHROUGH – HD

    Dorfromantik Board Game Review I Award Winning Game

    Dorfromantik Board Game Review I Award Winning Game

    Honest Game Trailers | Fall Guys: Ultimate Knockout

    Honest Game Trailers | Fall Guys: Ultimate Knockout

    ‘I don’t actually play horror games’: Phasmophobia’s lead developer had no intention of making a horror game but still kicked off a whole new genre

    ‘I don’t actually play horror games’: Phasmophobia’s lead developer had no intention of making a horror game but still kicked off a whole new genre

  • Tesla
    Weize New 2025 Tesla Model Y Juniper Floor Mats and Cargo Liners 5-Seat All Weather…

    Weize New 2025 Tesla Model Y Juniper Floor Mats and Cargo Liners 5-Seat All Weather…

    EcoNour Foldable Spring RV Windshield Sunshade, Reflective 240T Polyster Keeps Your RV…

    EcoNour Foldable Spring RV Windshield Sunshade, Reflective 240T Polyster Keeps Your RV…

    AIDEA Microfiber Cleaning Cloth, 100PK, Soft Absorbent Rags, Microfiber Towels for Cars,…

    AIDEA Microfiber Cleaning Cloth, 100PK, Soft Absorbent Rags, Microfiber Towels for Cars,…

    BMZX Car Trash Can Trash Bin, Accessories for Interior Mini Garbage Can, Car Door Trash…

    BMZX Car Trash Can Trash Bin, Accessories for Interior Mini Garbage Can, Car Door Trash…

    Young 200 lbs. 2 Bike Rack Hitch Mount Platform Style for Cars Trucks SUVs Minivans,…

    Young 200 lbs. 2 Bike Rack Hitch Mount Platform Style for Cars Trucks SUVs Minivans,…

    Tesla Full Self-Driving hasn’t improved all year and Musk points to more wait

    1 Pack for Tesla Key Card Protective Cover with AirTag Slot, Silicone Key Card…

    1 Pack for Tesla Key Card Protective Cover with AirTag Slot, Silicone Key Card…

    Dashboard Mobile Phone Holder, Non-Slip 360 Degree Rotatable Navigation Bracket,…

    Dashboard Mobile Phone Holder, Non-Slip 360 Degree Rotatable Navigation Bracket,…

    Skechers Car Floor Mats,Heavy Duty Rubber Car Mats Full Set,All WeatherFloor…

    Skechers Car Floor Mats,Heavy Duty Rubber Car Mats Full Set,All WeatherFloor…

  • UFO
    Mind Blowing Astral Plane Encounters!

    Mind Blowing Astral Plane Encounters!

    Extraterrestrial Secrets Unearthed In Antarctica…. #podcast #earth #fact #alien #theory

    Extraterrestrial Secrets Unearthed In Antarctica…. #podcast #earth #fact #alien #theory

    Alien Uprising

    Alien Uprising

    The Alien in my yard #shorts

    The Alien in my yard #shorts

    No Place to Run 2025

    No Place to Run 2025

    MW PODCAST: Roundtable …t in UFO Investigations

    MW PODCAST: Roundtable …t in UFO Investigations

    Xenonauts – Part 3 – Alien Research & Air Power

    Xenonauts – Part 3 – Alien Research & Air Power

    Ancient Aliens: TOP 4 SHOCKING ALIEN ARTIFACTS

    Ancient Aliens: TOP 4 SHOCKING ALIEN ARTIFACTS

    Roswell – The Complete Series (17-Disc Box Set)

    Roswell – The Complete Series (17-Disc Box Set)

No Result
View All Result
Techcratic
No Result
View All Result
Home Hacker News

The Hashtable Packing Problem

Hacker News by Hacker News
June 11, 2025
in Hacker News
Reading Time: 8 mins read
125 5
A A
0
Share on FacebookShare on XShare on LinkedIn

2025-06-08 03:04:00
backscattering.de

This is part of my project aiming to

  1. establish theoretical limits for bitboard based move generation in chess
    and similar games
  2. get as close to them as practically possible.

The Hashtable Packing Problem is an optimization problem encountered when
tuning Magic Bitboards in chess. Anyone trying to tackle it will have
suspected
that it is a hard problem, but (to my knowledge) so far no one has bothered
proving that.

But indeed: The abstract Hashtable Packing Problem is strongly
\(\mathcal{NP}\)-complete.
We can therefore stop looking for optimal solutions and instead
use heuristics (and still sleep well).

To follow the proof, no knowledge about chess or Magic Bitboards is required.
A brief discussion about the implications for Magic Bitboards follows at the end.

Definitions

Definition: A Hashtable (for our purposes) is a list of integers
\(\bar{b_0}, b_0, \ldots, \bar{b_i}, b_i, \ldots, \bar{b_n} \).

This means in memory it consists of \(\bar{b_0}\) occupied buckets, followed by
\(b_0\) empty buckets, followed by \(\bar{b_1}\) occupied buckets, and so
on, alternating, ending with \(\bar{b_n}\) occupied buckets.

Now imagine trying to arrange multiple hashtables in memory, possibly
overlapping, while trying to minimize the used space.

Definition: A Hashtable Packing for a list of hashtables
\(B_0, \ldots, B_m\) is a list of integer offsets \(o_0, \ldots, o_m\).

A hashtable packing is valid if none of the occupied buckets overlap, when
building a combined hashtable by placing the hashtables at the given offsets
in memory. That would be a hash
collision for the combined table!

Sketch

The first occupied bucket of the combined table is at \(\min_{0 \le i \le m} o_i\).
The last occupied bucket of the combined table is at
\(\max_{0 \le i \le m} o_i + \sum_{\hat{b} \in B_i} \hat{b} + \sum_{b \in B_i} b \).
The size of the hashtable packing is the number of buckets that need to be
reserved in memory, including empty buckets between occupied buckets:

$$ 1 + \max_{0 \le i \le m} o_i + \sum_{\hat{b} \in B_i} \hat{b} + \sum_{b \in B_i} b – \min_{0 \le i \le m} o_i $$

Suppose there is an efficient algorithm to solve the optimization problem,
i.e., to find a hashtable packing with minimal size, then there is also
an efficient algorithm to answer the following decision problem.

Hashtable Packing Problem: An instance of the Hashtable Packing Problem
is a list of hashtables and an integer \(K\).

The decision question is: Does there exist a valid hashtable packing for the
given hashtables with size not larger than \(K\)?

Reduction

3-Partition Problem: An instance of the 3-Partition Problem is an integer
\(L\) and a multi-set of integers \(a_0, \ldots, a_n\) with
\(\frac{L}{4} \lt a_i \lt \frac{L}{2}\).

The decision question is: Can the multi-set be partitioned such
that each partition sums to exactly \(L\)?

Observe that the restrictions on the \(a_i\) ensure that each partition would
have to contain 3 elements, which is why this problem is called 3-Partition.
The 3-Partition Problem is known to be strongly \(\mathcal{NP}\)-complete (Garey, Michael R. and David S. Johnson (1979), Computers and Intractability).

Lemma: Hashtable Packing is in \(\mathcal{NP}\).

Proof: We can easily verify in polynomial time that a given hashtable packing is
valid and achieves the desired size.

Lemma: Hashtable Packing is \(\mathcal{NP}\)-hard.

Proof: Let \(L, a_0, \ldots, a_n\) be an instance of 3-Partition.
We construct
a corresponding instance of Hashtable Packing in polynomial time.

First verify basic requirements: \(n\) needs to be divisible by 3, and
\(\sum_{i=0}^{n} a_i = \frac{n}{3}L\). Otherwise return a no-instance.

For each \(a_i\), create one hashtable that simply consists of \(a_i\)
occupied buckets.

Create \(\frac{n}{3}\) identical hashtables
as stencils: \(L+1\) occupied
buckets, followed by \(L\) empty buckets, followed by \(L+1\) occupied
buckets.

Is there a valid hashtable packing for these hashtables with size not greater
than \(K = \frac{n}{3} (3L + 2) \)?

The stencil hashtables are built so that they cannot overlap with each other.
Therefore each stencil contributes \(3L + 2\) to the size of any valid packing.
This means the packing size \(K\) can be achieved if and only if all
remaining hashtables fit in the empty buckets of the stencils, which
each have size \(L\). This is equivalent to the question asked in
3-Partition.

Proposition: Hashtable Packing is strongly \(\mathcal{NP}\)-complete.

Proof: We have already proven \(\mathcal{NP}\)-completeness.

Consider instances of 3-Partition where the largest number (\(L\)) is
restricted by a polynomial in the size of a reasonable (e.g., binary) encoding
of the
instance. Since 3-Partition is strongly NP-complete, the restricted version
remains NP-complete.

Apply the same reduction to create a corresponding instance of
Hashtable Packing. Observe that the largest number (\(K\)) is also
restricted
by a polynomial in the size of a reasonable (e.g., binary) encoding of the
instance.

This means that Hashtable Packing also remains \(\mathcal{NP}\)-complete
under such a restriction, in other words,
the unrestricted Hashtable Packing Problem is strongly \(\mathcal{NP}\)-complete.

Optimal packings for Magic Bitboards

Magic Bitboards
are a technique used to create lookup tables for sliding piece
attacks.
Optimizing Magic Bitboards is a complex intertwined problem:

  1. Find candidate magics factors that produce perfect hashtables, at least one
    for each piece type and square.
  2. Pick one magic factor for each piece type and square.
  3. Find the best possible hashtable packing.

This cannot be solved sequentially, for example the outcome of (3) might
inform the selection made in (2).
Regardless, to decompose this problem, suppose an oracle already revealed the
solutions
for steps (1) and (2) that will lead to an optimal solution.
Even then, the remaining problem is an instance of the
hard Hashtable Packing Problem. For Hashtable Packing we now know that
(due to \(\mathcal{NP}\)-completeness, unless \(\mathcal{P} = \mathcal{NP}\)):

  • There is no polynomial-time algorithm to find optimal solutions.

And (due to strong \(\mathcal{NP}\)-completeness, unless \(\mathcal{P} = \mathcal{NP}\)):

  • There is no pseudo-polynomial-time algorithm (for example using dynamic
    programming techniques) to find optimal solutions.
  • There is no polynomial-time approximation scheme to find optimal solutions,
    i.e., no polynomial-time algorithm that delivers solutions that are
    arbitrarily close to the optimum.
  • There is no polynomial-time algorithm to find optimal solutions,
    even when instances are
    encoded with size proportional to the number of buckets
    (e.g., in unary encoding).
    This may be interesting, because unary encoding closely resembles
    the memory representation typically used when validating magic factors.

The instances we are interested in are quite large: Hashtables for
64 rook squares + 64
bishop squares, each with between \(2^4\) and \(2^{12}\) buckets. So
asymptotics are likely to be important!

On the other hand, asymptotic results say nothing about individual instances.
There may even be a restricted set of instances that contains all instances
we care about (including Magic Bitboards in chess), but still can be solved
efficiently.

Then again, the instances we created in the reduction are already quite
restricted: Hashtables have similar size,
and a very limited number of gaps.
The only sources of additional useful
restrictions can be the interaction of (a) the rules of the game
with (b) the particular family of employed hash functions.

We can conclude that an optimal solution cannot efficiently be obtained by
decomposing the problem and abstractly working with the resulting hashtables.
We would have to exploit deeper
connections (if they even exist) between the rules of the game and
mask-multiply-shift hash
functions.

Such insights seem out of reach. At least we now have a good justification
to stop looking for optimality and to employ heuristics
(like Volker Annuss already did successfully).


niklasf, 13th February 2020, discuss on Talkchess.

Source Link


Keep your files stored safely and securely with the SanDisk 2TB Extreme Portable SSD. With over 69,505 ratings and an impressive 4.6 out of 5 stars, this product has been purchased over 8K+ times in the past month. At only $129.99, this Amazon’s Choice product is a must-have for secure file storage.

Help keep private content private with the included password protection featuring 256-bit AES hardware encryption. Order now for just $129.99 on Amazon!


Start your free Amazon Prime trial
today and unlock unlimited streaming and more!

Help Power Techcratic’s Future – Scan To Support

If Techcratic’s content and insights have helped you, consider giving back by supporting the platform with crypto. Every contribution makes a difference, whether it’s for high-quality content, server maintenance, or future updates. Techcratic is constantly evolving, and your support helps drive that progress.

As a solo operator who wears all the hats, creating content, managing the tech, and running the site, your support allows me to stay focused on delivering valuable resources. Your support keeps everything running smoothly and enables me to continue creating the content you love. I’m deeply grateful for your support, it truly means the world to me! Thank you!

BITCOIN

Bitcoin Logo

Bitcoin QR Code

bc1qlszw7elx2qahjwvaryh0tkgg8y68enw30gpvge

Scan the QR code with your crypto wallet app

DOGECOIN

Dogecoin Logo

Dogecoin QR Code

D64GwvvYQxFXYyan3oQCrmWfidf6T3JpBA

Scan the QR code with your crypto wallet app

ETHEREUM

Ethereum Logo

Ethereum QR Code

0xe9BC980DF3d985730dA827996B43E4A62CCBAA7a

Scan the QR code with your crypto wallet app

Please read the Privacy and Security Disclaimer on how Techcratic handles your support.

Disclaimer: As an Amazon Associate, Techcratic may earn from qualifying purchases.

Tags: Hacker News
Share162Tweet101Share28
Previous Post

UK FCA Creates New Deputy Chief Executive Role to Oversee Regulation of Stablecoin and Crypto Firms

Next Post

MacOS 26 envy? 4 best features that Windows PC users can already use

Hacker News

Hacker News

Stay updated with Hacker News, where technology meets entrepreneurial spirit. Get the latest on tech trends, startup news, and discussions from the tech community. Read the latest updates here at Techcratic.

Related Posts

GitHub – firstrow/mcwig
Hacker News

GitHub – firstrow/mcwig

June 12, 2025
1.3k
hunterirving/pico-crossing: hack Animal X-ing with a Pi Pico and a GameCube Keyboard Controller
Hacker News

hunterirving/pico-crossing: hack Animal X-ing with a Pi Pico and a GameCube Keyboard Controller

June 12, 2025
1.3k
Making eyesite
Hacker News

Making eyesite

June 11, 2025
1.3k
GitHub – bloom42/markdown-ninja: Markdown-first CMS for bloggers, minimalists and startups. Open Source alternative to Substack, Mailchimp and Netlify
Hacker News

GitHub – bloom42/markdown-ninja: Markdown-first CMS for bloggers, minimalists and startups. Open Source alternative to Substack, Mailchimp and Netlify

June 11, 2025
1.3k
mgschwan/viture_virtual_display: Virtual display with Viture Pro XR glasses using hdmi in on an OrangePi
Hacker News

mgschwan/viture_virtual_display: Virtual display with Viture Pro XR glasses using hdmi in on an OrangePi

June 11, 2025
1.3k
Tim Owens Jazz and Broadcast Collection Digitized by a Generous Grant by The Recording Academy’s GRAMMY Museum Grants Program – University Libraries
Hacker News

Tim Owens Jazz and Broadcast Collection Digitized by a Generous Grant by The Recording Academy’s GRAMMY Museum Grants Program – University Libraries

June 10, 2025
1.3k
Load More
Next Post
MacOS 26 envy? 4 best features that Windows PC users can already use

MacOS 26 envy? 4 best features that Windows PC users can already use

LEGEND OF ZELDA – THE MINISH CAP | #4 | WALKTHROUGH | CORRUPTOR GAMING |

LEGEND OF ZELDA - THE MINISH CAP | #4 | WALKTHROUGH | CORRUPTOR GAMING |

2 HOUR JOB SEARCH

Sr. DSP R&D Engineer - C/C++, Wireline, Simulink, ASIC

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Your Tech Resources

  • 30 Second Tech ™
  • AI
  • App Zone ™
  • Apple
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo
  • Google News
  • Hacker News
  • Harvard Tech
  • I Like Cats ™
  • I Like Dogs ™
  • LifeHacker
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • PC World
  • Photofocus
  • Physics
  • Random Tech
  • Retro Rewind ™
  • Robot Report
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Art
  • Tech Careers
  • Tech Deals
  • Techcratic ™
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Weird Stuff
  • Wired
  • ZDNet

Tech News

  • 30 Second Tech ™
  • AI
  • AnandTech
  • Apple Insider
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • ExtremeTech
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo

Tech News

  • Harvard Tech
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • Physics
  • PC World
  • Random Tech
  • Retro Rewind ™
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Careers

Tech News​

  • Tech Art
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Weird Stuff
  • Wired
  • ZDNet

Site Links

  • About Techcratic
  • Affiliate Disclaimer
  • Affiliate Link Policy
  • Contact Techcratic
  • Dealors Discount Store
  • Privacy and Security Disclaimer
  • Privacy Policy
  • RSS Feed
  • Site Map
  • Support Techcratic
  • Techcratic
  • Tech Deals
  • TOS
  • 𝕏
Click For A Secret Deal

Techcratic – Your All In One Tech Hub © 2020 – 2025
All Rights Reserved
∞

No Result
View All Result
  • Home
  • Apple
  • Gaming
  • Microsoft
  • AnandTech