An example where the algorithm of Hopcroft and Karp performs poorly?

I have been trying to construct an example, where Hopcroft and Karp’s algorithm for the maximum matching problem performs poorly (say at least $ \Omega(\log n)$ rounds). However, all the examples I came up with where solved on paper in almost constant number of rounds.

Other questions here in the community targeting this problem tackle the worst-case running time or the time-bound proven in the original paper.

This running time seems to be a bit too loose, especially because the maximum matching problem in general and in bipartite graphs lacks a conditional lower-bound on its running time and I couldn’t find any tight lower-bound on the number of needed rounds. I couldn’t find a bound on the number of needed operations in constrained models of computing either (For example binary decision tree or so).

On the other side, the $ O(\sqrt n)$ bound on the number of rounds from the original paper has not been improved since was found in the 1973 except in the parameterized context and in special classes of graphs.

Any ideas/suggestions are much appreciated 🙂

How do I minimize the cost of some algorithm that performs some operation on a list?

I stumbled upon this problem whilst studying the complexity of a simple algorithm. I used set-theoretic notation, but all the $ S_i$ ‘s are lists (I couldn’t think of a better way to write the problem precisely). The “hint” is more of a conjecture which I can’t prove than a hint.

Let $ S_0 = \{s^0_1, …, s^0_n\}$ be a list containing $ n$ positive integers. Let $ k$ be the length of $ S_{i – 1}$ , and define $ S_1, …, S_{n – 1}$ recursively as follows: choose $ 1 \leq r, s \leq k, \quad r \neq s$ , and define \begin{equation*} S_i := (S_{i – 1} \setminus (\{s^{i – 1}_r\} \cup \{s^{i – 1}_s\})) \cup \{s^{i – 1}_r + s^{i – 1}_s\} \end{equation*} E. g. \begin{align*} S_0 &= \{2, 3, 5\} \ S_1 &= \{5, 5\} \ S_2 &= \{10\} \end{align*} Clearly, $ S_{n – 1}$ has a single element. Also, define $ W_i := s^{i – 1}_r + s^{i – 1}_s$ . Consider the quantity $ \sum_{i = 1}^{n – 1} W_i$ . In the previous example, this quantity can be $ 15$ or $ 18$ . How do you have to choose $ r$ and $ s$ in each step so that $ \sum_{i = 1}^{n – 1} W_i$ is minimal?

(Hint: Pick $ r, s$ such that $ s^{i – 1}_r = \min_{x \in S} x$ , and $ s^{i – 1}_s = \min_{y \in S \setminus \{x\}} y$ .)

Can’t resume after suspension/hibernation/display off that xfce power manager performs automatically

I’m having trouble resuming from both suspension and hibernation that the xfce power manager performs automatically. I mean, for instance, I set up my pc to hibernate when the battery reaches the critical level. But I’m unable to resume. The pc does not respond. I have to press the power button and it powers off. And then, start the system again.

Also, when the power manager powers off the screen due to idle time, exactly the same happens. I have to press the power button and start the system again.

I have tried this having in mind that the problem was about permissions when not logged in. But it didn’t make any difference.

When I use the commands sudo pm-suspend or sudo hibernate everything works fine. But the command xset dpms force off triggers the same problem.

By the way I’m using debian 10 on an lenovo ideapad 100 with Intel celeron. (I moved from xubuntu to Debian hoping that would solve the problem)

Assuming that everyone always performs a revocation check, do we still need expiration time in each certificate?

I understand that each public key certificate includes an expiration time, and a CRL is issued periodically, listing all currently revoked certificates. However, in class we were told to think about whether or not we still needed expiration time in each certificate assuming a revocation check is always performed. I feel like we would still need an expiration time in each certificate because then, how would we know when a certificate is revoked?

If anyone could help broaden my mindset, it would be much appreciated

School performs periodic password audits. Is my password compromised?

My university sent me an email informing me that, during a “periodic check”, my password was found to be “easily discoverable and at risk of compromise”. As I understand it, there shouldn’t be a way for them to periodically check my password unless my password was stored in plaintext. My question:

  • Is my understanding wrong, or has my university been storing my password in plaintext?

Simplify ReactJS code that performs profile pic selection highlights

I am making a profile picture selection screen, basically you select a picture pic1, if another picture pic2 is selected, then we cancel the highlight of pic2 and highlight pic1. Here is my code right now for it in React (btw, I am using CSS to take care of the highlighting).

How I am doing it currently (let’s say I only have 3 options to choose from), this is the code taking care of determining which one is clicked:

`  this.state = {       isClicked1: false,       isClicked2: false,       isClicked3: false     };` 

The JSX code that actually displays everything:

                 <img src={hero001} />                 </a>                 <a class={a_class2} onClick={this.profilePicClick2}>                   <img src={hero002} />                 </a>                 <a class={a_class3} onClick={this.profilePicClick3}>                   <img src={hero003} />                 </a> 

the class is actually what determines if it is highlighted or not (background color in CSS), if the class is animal selected then it has a background else no background.

let a_class1 = this.state.isClicked1 ? "animal selected" : "animal"; let a_class2 = this.state.isClicked2 ? "animal selected" : "animal"; let a_class3 = this.state.isClicked3 ? "animal selected" : "animal"; 

And the JS logic:

    profilePicClick1 = () => {     this.setState({ isClicked1: !this.state.isClicked1 });     this.setState({ isClicked2: false });     this.setState({ isClicked3: false });   };    profilePicClick2 = () => {     this.setState({ isClicked2: !this.state.isClicked2 });     this.setState({ isclicked3: false });     this.setState({ isClicked1: false });   };    profilePicClick3 = () => {     this.setState({ isClicked3: !this.state.isClicked2 });     this.setState({ isclicked1: false });     this.setState({ isClicked2: false });   }; 

Here’s a run through sorry if my code is confusing: on load, the isClicked state for all images is false, that leads to each a_class being “animal”, and on render, it will display the images with the a_classes, since it is only animal, we will display the normal image. Onclick of let’s say image1, we will turn isClicked1 into true, which will make a_class1 “animal selected”, and will thus render the picture with the background selected color. And onClick of another picture other than pic1, we will set all other isClicked to false besides the one just being clicked, and blah blah.

How do I show that an iterative solution to Tower of Hanoi performs the same exact steps as a recursive solution?

So given the typical recursive solution to the Tower of Hanoi problem wherein you reduce the n-disk tower to two instances of an (n-1)-disk tower i.e

  1. move (n-1) disks from start to auxiliary.
  2. move the largest disk from start to destination.
  3. move (n-1) disks from auxiliary to destination.

how do you then show that an iterative algorithm (shown below) performs the same exact steps? Intuitively you’d be using induction on $ n$ , but as to how that is done I’m not sure.

The iterative algorithm is as follows:

If $ n$ is even, swap pegs $ 1$ and $ 2$ . At the $ i$ th step, make the only legal move that avoids peg $ i$ mod $ 3$ . If there is no legal move, then all disks are on peg $ i$ mod $ 3$ , and the puzzle is solved