Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 786081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:58:54+00:00 2026-05-14T20:58:54+00:00

What algorithms (brute force or not) would I use to put in as many

  • 0

What algorithms (brute force or not) would I use to put in as many cars (assume all cars are the same size) in a parking lot so that there is at least one exit (from the container) and a car cannot be blocked. Or can someone show me an example of this problem solved programmatically.

The parking lot varies in shape would be nice but if you want to assume it’s some invariant shape that is fine.

Another Edit:
Assume that driving distance in the parking lot is not a factor (although it would be totally awesome if it was weighted factor to number of cars in lot).

Another Edit:
Assume 2 Dimensional (no cranes or driving over cars).

Another Edit:
You cannot move cars around once they are parked (it’s not a valet parking lot).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:58:54+00:00Added an answer on May 14, 2026 at 8:58 pm

    Well, let’s simplify/concreteify a bit. Assume that our cars are unit squares, the parking lot is N x N, and we need to enter/exit from the lower left corner. A simple pattern gets the lot almost 2/3 full with cars (shown for N=12):

    +------------+
    |C CC CC CC C|
    |C CC CC CC C|
    |C CC CC CC C|
    |C CC CC CC C|
    |C CC CC CC C|
    |C CC CC CC C|
    |C CC CC CC C|
    |C CC CC CC C|
    |C CC CC CC C|
    |C CC CC CC C|
    |C CC CC CC C|
                 |
      -----------+
    

    I can prove that the best you can possibly do is to get the lot 2/3 full. Imagine that you build up the empty spaces by starting with a completely full garage and driving out a (currently reachable) car one at a time. Each time you remove a car, you produce up to 3 newly reachable cars, and remove one once-reachable car (now an empty space). So for every space you make, you create at most 2 more reachable cars. To make 2/3 N^2 reachable cars, you need to make at least 1/3 N^2 spaces, and that’s all the squares you have. So you can fill the garage at most 2/3 full.

    The simple pattern above is asymptotically optimal, as its density approaches 2/3 as N -> infinity. (Kinda boring, I was hoping some tree-looking pattern would do better.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am solving a 0-1knapsack problem. I solved the problem by brute force algorithm.
Some background: I'm writing a more or less brute force search algorithm for solving
I'd like to calculate all the permutations of size Y of a set of
I was trying to solve ITA Software's Word Nubmers puzzle using a brute force
In encryption, would two symmetric algorithms be considered to be equal in terms of
Which algorithms or data structures are used in auto-suggest features? It seems that edit-distance
Just started learning algorithms. So the exercise is to find if statement is always/sometimes
Started learning algorithms. I understand how to find theta-notation from a 'regular recurrence' like
Are there any compression algorithms -- lossy or lossless -- that have been specifically
Are there any algorithms available for analyzing the complexity of an image? Basically I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.