This is a twin post of – I guess – a good one that I wrote a long time ago: I was just surfing the blog thinking about all I would like to do, and I came to my old thoughts. I was curious, you know? so I read it, and read it once again, I reflected a bit on it – and I found it inspiring in a sense: even better, I would say I found myself surprised to agree with myself of almost 1 year and a half ago, in most of the things I wrote. For me, it was an important moment because it has been like a kind of retrospective. This is the reason I wanted to give this new lifestyle-kind-of post just the same title as his father. Like: I’m still learning. Or even better: I’m still learning – Revenge of the Fallen but I wanna warn you, once again – this is a deeply full-of-truth-and-complaints post – ok no, just kidding. This is more kind of a story, in five Chapters.
Chapter I – About companies
In the last year, I still fought against the processes. But this time, let’s analyze the things from a mathematical perspective – because today if you don’t speak about data and models, nobody hears you. Let’s give the theoretical machine learning definition of a modern AI company: a modern AI company is a WUG – a.k.a. an Weighted Undirected Graph – that links at least three different families of nodes – Employees, Processes and Projects – in a chain of skills, troubles, goals, beers, prizes, achievements, careers, promotions, pizza, parties, lies and God only knows what else, with the overall goal to solve (or introduce) dependencies, investigate (or ignore) consequences but, by the end of the day, feed the so hungry desire to “change something” – also referred to as “bring something in production”. Unfortunately, before going ahead we need to provide a formal definition of a WUG – sorry, a Company. Thus…
Formally, we define a Company as a pair:
- is the set whose elements are called vertices or nodes, that can be of three kind, with:
– refers to Projects with cardinality the budget of the year;
– refers to Processes with cardinality the cost of Service Now;
– refers to Employees with cardinality the headcount allowed by HR;
- is the set of two-sets (set with two distinct elements) of vertices, whose elements are called edges, that link together the nodes (Employees, Processes and Projects). Even if there’s no formal demonstration, some studies suggest the cardinality of is strongly influenced by the cardinality of , the budget, the headcount, and God only knows what else;
Furthermore, our Company is a WUG and in a Weighted Graph a number, the weight, is assigned to each edge. For the moment, it’s sufficient for you to have in mind that such weights, in graph theory, might represent for example costs, lengths or capacities, depending on the problem at hand. Also, we can ignore the formalization of the three different kinds of nodes, but not completely, because I will get back on it later. There’s a name for structures that are almost like this and it’s funny because are called Forests. Confused? No worries, it’s because you’re still not a good Employee 👀
Chapter II – About employees
Ok, so in a digital Forest like the one just described, you cannot move with weapons to defend yourself against pumas – or whatever else lives inside a real forest with the desire of eating you and your backpack full of energy bars. Instead, the good Employee inside the WUG. Sorry, the Forest. Sorry again, in the Company, uses his ability and applies the Prim’s algorithm. Now, before going ahead, it could be useful to remind some concepts about graph exploration.
The Prim’s algorithm is a greedy algorithm that finds a minimum spanning tree for a weighted undirected graph. The fact is, the good Employee is really good in this kind of exploration, even if (s)he sucked in the exam of Algorithm and Data Structure. What does exactly finding the minimum spanning tree mean? The following is the best explanation I can provide – I hope it will be clear, if it’s not please don’t blame me, I’m a bad Employee.
Finding the minimum spanning tree means finding a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is minimized.
Clear? If I didn’t lose you already, you should now ask yourself “What the hell these weights refer to now?!”
For the sake of truth, I mentioned the weights before, without explicitly saying these were the weights. I will list them with names and values. Imagine the weights as fixed distinct discrete values – with names, because it’s easier to reasoning over names than values. I chose to put the values in the range [-50, +50] with a step of 10 because it’s my article and I do what I want. To be also compliant, I would avoid giving value to some of the weights: it’s up to every good Employee to look into his/her heart and put the value for them. There’s also a Positive Value column: basically, it’s built by shifting the Real Value column in the positive range [0, +100]. This is only because many of the algorithms that operate over graphs need positive weights: I keep it also the negative ones for small reasoning after the table.
|Id||Weights Enum Names||Real Value||Positive Value|
|14||God only knows what else||Nan||Nan|
Of course, you can add as many weights as you want. The first thing to note, if you consider the Real Value column, is that we want to minimize the overall cost of spanning the projects, and this explains the positive values – something like troubles need to be avoided because who wants troubles?! – and of course prizes, goals, achievements are the things every good Employee would like to gain/reach/obtain, and this explains the negative values. Responsibility? Who wants them? It’s better having pizza, parties, and meetings – ok on the last wait, it depends. Got it? 😉 Back to the algorithm, we defined what the Prim’s algorithm does, but we didn’t explain how it works. Well, let’s see the algorithm.
Chapter III – About the algorithm
The Prim’s algorithm works by building this tree one vertex at a time, from an arbitrary starting vertex, at each step adding the cheapest possible connection from the tree to another vertex. It’s really good actually because it’s
- greedy, because it evaluates each time the best local solutions without questioning the previous choices;
- exact, because it provides a precise solution for each instance of the problem without making rounding or inaccuracies of any other nature;
- optimal, because it’s used by the good Employee. Just kidding, it’s because it presents the best solution (or, one of them if they are more than one);
Anyway, the algorithm follows this steps:
- Start with a Company;
- Choose an Employee node;
- Choose the shortest edge from this Employee and add it;
- Choose the nearest vertex not yet in the solution;
- Choose the nearest edge not yet in the solution, if there are multiple choices, choose one at random;
- Repeat until you have the minimum spanning tree;
If you remember, in the beginning, I said: “We have three different kinds of nodes: forget about this for the moment”. Ok, now going back to this assumption, what we gonna do is actually change the Prim’s algorithm, in particular, the behavior of step 5, to enables priorities and be more Company-compliant. Thus, we wanna have a procedure that collects as much as possible
Project nodes, without touching a lot of
Employee nodes, and always trying to avoid as many
Processes nodes as it can – but ATTENTION PLEASE!!! this deeply depends on the kind of interpretation you wanna give to the weights, the
Employee nodes and God only knows what else. In the good Company, it seems that collecting the right
Project nodes give more direct benefits than deal with the wrong
Employee nodes, by passing through tricky
Processes nodes: what a coincidence 🤔
Let’s write the procedure to implement the Extended Prim algorithm – the good Employee variant.
Back to the structure, now that the Company is formalized, the vertices are defined, the links between them are weighted, and the algorithm is presented, I think we can make an example and hopefully we will start the light at the end of this crazy tunnel. Let’s draw a Company .
Ok, to keep things simple, since we have a Company , let’s isolate some entities as shown in picture below. We choose an Employee node: let’s take the Employee n.3 (
Emp_3). (S)he knows that work on Project B (
Pj_B) could change his/her career in better (weight_ID: 07
Careers. It’s…how much? -30 (+20)? Or +30 (+70)? I think it depends on Employee n.3’s life priorities) but (s)he has to accept (s)he will need to go through the Process n.2 (
Pr_2), that will cause a lot of troubles (weight_ID: 02
Troubles). (S)He also knows that collaboration with Employee 1 (
Emp_1) will require a lot of meetings (weight_ID: 12
Meetings) and God only knows what else will happen if (s)he will go for the Project A (
Pj_A) (weight_ID: 14
God only knows what else) instead of Project B (
Pj_B). Since each good Employee populate his/her Company with weights the overall idea should be clear.
Chapter IV – About the Employee n.15
Now let’s create an agnostic example and put some random weights: I also put some integer labels to all the nodes… because I’m not a good Employee and I need help in executing the Prim’s Algorithm. This time, let’s play the role of
Employee n.15: (s)he has to find this minimum spanning tree inside this piece of Company to make things work.
Let’s follow the Prim steps one by one using the labels we put and this magic library called the Good Employee on Github. I used it with the following
.wug (Weighted Undirected Graph) file I prepared to get the correct minimum spanning tree. So fuck you,
Employee n.15 🤟
Ok so, let’s analyze the goodness of the
Employee n.15 step by step.
|1||At the very beginning, the
|2||To gain the chance on working on
|3||At this point, the
|5||To respect mandatory company policies, the intern
|6||The fact is, working with
|7…10||And so on until the last node is visited. With overall cost of 271.|
Chapter V – About the minimum spanning tree
We spoke a lot about the minimum spanning tree, but it’s actually the only entity I didn’t explain inside the Company . If you didn’t get it, I already defined even this one… remember the definition of the modern AI company, that is a WUG – a.k.a. an Weighted Undirected Graph – that links at least three different families of nodes – Employees, Processes and Projects – in a chain of skills, troubles, [..] and God only knows what else, with the overall goal to solve (or introduce) dependencies, investigate (or ignore) consequences but, by the end of the day, feed the so hungry desire to “change something” – also referred to as “bring something in production”. The latter is exactly the meaning of the minimum spanning tree: the “let’s work on something”, that drives every good Employee in the hard path of solving or introducing dependencies (like SAP), investigating by ignoring consequences (it works, don’t touch it) but, by the end of the day, being able to say “I brought some changes” – that is translated in (S)He brought something in production.
And in a moment, somehow, I understood how every employee finds her/himself in this network of entities, and has to deal with all of them in a sense, better, (s)he has to take a real direction, building the spanning tree, that it’s minimum, and this is… well, bad. I have this feeling every good Employee of every good Company is not so a good Employee by acting like this: yes, some of them apply Djistrka (the original one, be careful) to go straight to the point, but by the end of the day they just wanna execute, avoid, survive, conquer, always by respecting the majority of the beliefs, but first always having someone or something else taking care of their shit. I think a Company should act by taking into consideration this good Employees’ attitude. Because, the result is that nobody is able to deal with a world that is changing to fast, but is super good in graph exploration. Moreover, there is always someone who knows more than someone else, on this, on the other, who is more suitable than someone else.
This state of confusion leads to the fear of hiring people who are not expert in something, that is not able to solve company’s actual problem: that problem arose yesterday, come out months before, without nobody looking in the right direction, because the minimum_spanning_tree rules them all. Year after year. Again, maybe I am a dreamer, but I think it’s more interesting having someone with some interests and put him/her in the condition of learning how to solve problems in his/her field of competencies, instead of having people teaching or delegating all the time. Someone with the will of change (her)himself, instead of someone only able to explore the graph and yes, by the way, once again, this basically concerns how the people are chosen.
Ok, recruiters, you could be or not part of The company, but you are of course part of A company, I guess. Listen to me: it’s not a matter of what a candidate can do, what he has done or he’s actually doing: the employee should be evaluated more on how much they can learn and how fast they are in doing it than on how much they know and how much they can already do. Even my professor of Maths was not able to resolve the problems – at least, not so fast as its students – that he proposed to us after so many years of teaching. He has an incredible background, plenty of logic, theorems, fundamentals, etc. But he’s not a machine: people forget things. The point is: how much fast are you in re-learning something? This what you should look for: evaluate people to hire – but also, and mostly (I guess) already in the company – to find out if they are still interested in learning, in what they do for the company, and eventually why, if they are not anymore. The willingness to learn should be the ONLY choosing driver because the knowledge is ephemeral, the curiosity is not.
What can I say to conclude: in the age of flexibility, immutability, scalability, veganability, accountability, and everything else you can find in a job-post that doesn’t coincide with the name of a Pokemon I can only wish you “Good exploration, explorers!”. Unfortunately, I always hated graph theory and the exploration of data structures of any kind.