Skip to content

Israeli Queues are a variation of Priority Queues where instead of associating priority with the element to be enqueued, the priority is implicitly derived using the "friend" element and it joins right at the back end of the group that the friend belongs to.

License

Notifications You must be signed in to change notification settings

YonLiud/Israeli-Queue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Logo

Israeli Queue

A variation of Priority Queues where the priority of elements can change dynamically based on their relationships with other elements in the queue

About Israeli Queue

Israeli Queues are a playful take on this real-world behavior, where the priority of elements in the queue is influenced not only by their inherent priority but also by their relationships to other elements already in the queue. This results in a more complex and realistic simulation of how queues might work in certain social contexts.

Key Characteristics:

  • Dynamic Priority: Unlike traditional priority queues where each element has a fixed priority, in Israeli Queues, the priority can change based on the position and relationship with other elements in the queue.
  • Group Influence: Elements can be grouped, and elements within the same group may join each other, altering the order of the queue.
  • Real-World Simulation: This algorithm provides a closer approximation to real-world scenarios where social relationships and behaviors affect queuing order.

Applications:

  1. Event Management: Israeli Queues can be used in event management systems where attendees might have VIP passes or group entries that allow them to join the queue at different points.
  2. Customer Service: In customer service scenarios, regular customers or members of loyalty programs might receive different queuing treatment.
  3. Simulation and Modeling: This concept can be used in simulations that require a more nuanced approach to queuing, reflecting human social behaviors.

Getting Started

To get the module working simply follow these steps:

Installation

pip install IsraeliQueue

Usage Example

Sort by Key

carbon-1

Returns: [Item(item='Noy', group=0), Item(item='Nitzan', group=0), Item(item='Omry', group=1), Item(item='Omer', group=1), Item(item='Oz', group=1), Item(item='Alma', group=2)]

Sort by Type

carbon-2

Returns: [[2, 4], ['Alex', 'Robert'], [[0.4, 0.9]]]

License

Distributed under the MIT License. See LICENSE.txt for more information.

Links

About

Israeli Queues are a variation of Priority Queues where instead of associating priority with the element to be enqueued, the priority is implicitly derived using the "friend" element and it joins right at the back end of the group that the friend belongs to.

Topics

Resources

License

Stars

Watchers

Forks

Languages