Image unshredding using a TSP solver
github.com
github.com
I remember having a lot of fun solving it, in Coffeescript (which was all the rage at the time), also with TSP but using the Pearson correlation coefficient as the similarity metric: https://gist.github.com/stevekrenzel/1505619
Here's a little demo of it in action: http://krenzel.org/files/insta/
Your company needs to revise what they mean by "average."
Really nasty, lots of headaches, complexity, risks, and/or people think it's magic.
In my experience what usually happens is a programmer's "worth" is hugely dependent on the scale of the organization, moreso than nearly every other individual contributor-level role, which means that smaller orgs have an extremely difficult time competing with larger orgs.
For example, suppose at some company there is a business process that generates $1 billion in annual revenue, and a programmer has implemented something that can increase that by, say, .2%. So the programmer's "worth" in that situation is 2 million dollars.
A much smaller company only does $10 million in annual revenue, so the commensurate .2% improvement is only worth 20k.
This is a gross oversimplification, of course, but it really gets to the heart of way the FAANGS can pay such huge salaries and suck up a lot of the best talent. It's not that all the other companies are being stingy, it's just that in many cases they can't pay a programmer anywhere near what a FAANG can because that programmer just can't generate that much business value at a smaller company.
And the number of employees also affects the types of efficiencies you can introduce; the likelihood of finding something that will increase revenue at a higher percentage for a large company is drastically lower than the likelihood of finding something that will increase revenue at a higher percentage for a small company. And that's if it's percentage based in the first place, rather than fixed savings.
Anyway, relatedly, it has more to do with the fact that a lot of the leading tech companies have a high amount of revenue -per employee-. That is, revenue/employee = big number. There's a few different reasons for that, but that's the main thing. Per the example above, it's really more like a company doing $1 billion in revenue has 10k employees, and another doing $100 million has 5k employees. Obviously the former has more to spend on employees, as they're generating more with fewer.
Under that model taken as-is there are some interesting features:
- The company could fire all the engineers and coast if the product is "done". Mostly reasonable, though products are never done.
- More "solve for the equilibrium", engineers are paid for the present value of their contributions rather than some proportion of current revenues. Depends on the company either being well-funded, paying in stock, or being able to take on debt. Again, rings true-ish? Hard to measure so obviously expected present value will differ greatly from the actual value.
There may be a profit shortage among companies claiming they can't find people to hire.
https://www.dw.com/en/how-ai-could-solve-a-600-million-piece...
https://www.wired.com/2008/01/ff-stasi/
https://boingboing.net/2018/01/09/truth-reconciliation-and-t...
Surprisingly, there's never been an HN thread about this (as far as I can tell).
From the Wired link: "Today, the study in Poppe's Berlin apartment is lined floor to 12-foot ceiling with bookshelves full of volumes on art, literature, and political science. But one shelf, just to the left of her desk, is special. It holds a pair of 3-inch-thick black binders — copies of the most important documents in Poppe's secret police files. This is her Stasi shelf."
Great movie, by the way.
I would recommend Ken Loach's Fatherland instead; but - only until when Dritterman arrives in the UK (the end of the film is kind of messed up).
[1] https://en.wikipedia.org/wiki/DARPA_Shredder_Challenge_2011 [2] https://archive.darpa.mil/shredderchallenge/index.html
A laser or enzymic based method could work but neither are particularly office-friendly.
Once a week, this big-ass tandem truck would park outside the entrance, and the janitors would carry out boxes of papers, under armed guard.
The truck had a huge shredder (crosscut), and also a big kiln.
Once the paper was shredded, it was burned, and the ashes were shredded, just to be sure.
Then, the truck would take the ashes away; never to be seen again.
I’ll bet Iron Mountain still does it (this was before Iron Mountain, but it could have been the same folks).
If you're just handed a pile of confetti you don't have that same correspondence.
On the other hand physical shredders typically have other weaknesses, for example if you don't stir the shredded result you have a high correlation between original the current and original relative position of the individual pieces.
[0] https://en.wikipedia.org/wiki/Burrows%E2%80%93Wheeler_transf...
That is not the difficulty with TSP. The problem doesn't get any easier if you can end wherever you please.
It still seems to me that bowl-stacking is solved by sorting alone, though, which is of course much simpler.
Having a sparse representation in a DCT basis would be an even better metric. You want the unshredding which makes the (e.g.) 8-pixel wide horizontal DCT's have the lowest norm. Because this metric depends on more than just pairs of lines though it's not obvious how to construct an efficient TSP out of it.
One could easily take a TSP solution and post process using the DCT metric, testing out all possible swaps (or near ties in the TSP solution).
Paper fiber length dictates a lot about its reuse. The bigger the chunks the smaller the combinatorics for reversing the 'algorithm'. Big paper mache blobs might fare better. From a recycling standpoint a machine that tears the paper instead of cutting it would do better, but the uniqueness of the edges probably reduces the problem space.
If someone invents a fast paper pulping machine that can mount on a small truck that doesn't require a commercial vehicle license, I bet you could sell loads of them.
Whatever happened to that team who used microcavitation to blast the ink off of paper for reuse? Probably enough solvents left behind to read the text like invisible ink, but as a first pass it might be good.
@robinhouston The word “perfectly” was used too many times
:-P1. use a cross-cut shredder
2. mix many different shred jobs in the same bag
3. mix the contents of multiple bags
4. deposit different bags in different trash runs
5. just burn it
That is to say: by reducing the objective to this you are assuming the image is continuous on the horizzontal axis, while in image processing images are usually supposed to be only piecewise continuous.
You can paste together possible scenes to construct side-scrolling game scenery in realtime.
By applying a few insights we can phase one image into a hole that is in another image. This is similar to randomizing an array by creating a second array with random values, then sorting them in tandem, except we use the TSP with expected weightings.
There are lots of use cases for this.
Same goes for file systems as well as the wear leveling layer of SSDs.