Inferring Company Structure from Limited Available Information
In this paper we present several algorithmic techniques for inferring the structure of a company when only a limited amount of information is available. We consider problems with two types of inputs: the number of pairs of employees with a given prop…
Authors: Mugurel Ionut Andreica, Angela Andreica, Romulus Andreica
Inferring Company Structure from Lim ited Available Inform ation Mugurel Ionut Andreica, Polite hnica University of Bucharest, mugurel.andreica@cs.pub.ro Romulus Andreica, Angela Andreica, Commercial Academy Satu Mare Abstract: In this paper we present several algorithmic techniques for inferring the structure of a company when only a limited amount of information is available. W e consider problems with two types of inputs: the number of pairs of employee s with a given property and restricted information ab out the hierarchical structure of the company. We provide dynamic programming and greedy algorithms for these problems. Keywords: inferring company structure, pairs of employees, hierarchical structure, dynamic programming. 1 Introduction There are many sit uations in which an in-d epth analysis of a company needs to be performed, b ut only limited information is a vailable about its structure and hierarchy. In this paper w e pr esent algorithmic techniques for inferring the structure of a company based on ver y limited available information. We consider two types of problems, based on the input which is pr ovided: problems where the input contains the number of pairs of employees with a given property and problems w here the input contains restri cted information about the hierarchical structure of the company. W e provide dynamic pro gramming and greedy algorithms fo r these problems. The rest of this paper is structure d as follows. In Sections 2, 3 and 4 we discuss pr oblems with the first type o f input. I n Section 5 we discuss a probl em having the second t y pe of input. In Section 6 we present related work and in Section 7 we conclude. 2 Partitioning the E mployees into Dep artments A company has n employ ees and d departments. We know that there are k pairs of emplo yees working in the same department. We want to infer the values e 1 , e 2 , ..., e d , whe re e i is the nu mber of emplo y ees working in department i (0 ≤e i ≤n). The following condition must hold d i e i C k 1 2 (1) Moreover, we must have k≤n·(n -1)/2. We will solve a slightly different proble m first: given n and k, d etermine the minim um number of departments d the company ma y have. W e provide a dynamic programming algorith m for this problem. We will compute a table D min (i,j) representing the minimum number of departments the company must have if there are i employees and j pairs of employees working in the same department. We have D min (0,0)=0 and D min (0,j>0)=+ ∞. For i>0 and j=0 we have D min (i,j)=i; for i>0 and 0i·(i-1)/2, we have D min (i,j)=+∞. Since the value s j>k are o f no interest to us, it is easy to see th at the time complexity o f the al gor ithm is O(n 2 ·k). At a fi rst glance, this problem can be solved by a simple greedy algorit hm: SimpleGreedyAlgorithm(n,k): d=0 while ( k>0 ) do find the largest p such that p· (p - 1)/2≤k k=k-p· (p -1)/2 n=n-p return d+n However, a counterex ample is easy to give ( e.g. for n=12 and k=18). Now we can solve the initial problem. I f D min (n,k)≤d, then we hav e a solution and we can easil y compute this solution by tracing back the w ay the values in the table D min were computed (we store the value of p which minimized the value of each entry (i,j)). The departments D min (n,k)+1, ..., d will contain no employees. 3 Partitioning Bosses and Simple Employees into Departments A company has an unknown number d of departments. Within each department i (1≤i≤d), there is an u nknown number of bosses b i (b i ≥1) and an unknown number of simple employees e i (ei≥1). Each boss intera cts with each simple employee in his department. Th e onl y information available is the total number of interac tions TI: d i i i e b TI 1 (3) For this problem, a trivi al valid solution consists of 1 department, 1 boss and TI simple employees. Therefore we will be interested in finding the structure with the minimum total number of employees (bosses plus simple employees) and, in case of ties, th at with a minimum number of bosses. I n order to infer an opti mal company structure (the number of departments and the number of bosses and simple employees with in each department), we will use a dyna mic p rogramming algorithm. We will compute the tables TE min (i) =the minimum total number of emplo y ees if the total number of interactions is i and B min (i) =the minimum number of bosses if the total number of interactions is i and the total nu mber of employees is TE min (i) . We have TE min (0)=B min (0)=0. The pseudocode of the algorithm is given below: BossesAndEmployeesDynamicProgramming(TI): TE min (0)=B min (0)=0 for i=1 to TI do TE min (i)=B min (i)=+∞ for b=1 to i do for e=1 to i/b do if (( TE min (i -b·e)+b+ei·(i -1)/2)=false. For all the other situations: othe rw ise fa lse , true p )) - (i p j p, i}). OK (i , {1,3,4, ... (p if tr ue, j) OK (i, (4) If OK(n,k)=true , we can construct the communication graph by tra cing back the computation of the OK table entries. The time complexity of the a lgorithm is O(n 2 ·k). 5 Inferring the Hierarchical Structure of a Company A company has n empl oy ees organized into a hierarchical structure (each emplo yee has on e boss, except the compan y manager). W e will consider thi s structure a rooted, directed tree, wh ere each vertex corresponds to an employee and the parent of a vertex corresponds to the employee’s boss. Furthermore, the vertices are numbered from 1 to n. We only know two orderings of the tr ee vertices: the ordering corresponding to the depth-first (DF) traversal of th e tree (df(1), df(2), ..., df(n)) and the o ne corresponding to the breadth- first (BF) traversal (bf(1), bf(2), ..., bf(n)). For both traversals, the first visited vertex is the tree root. The children of a vertex are ordered in ascending order of their numbers and a re visited (expanded) according to this order (in both traversals). Based on these two orderings, we want to infer the tree structure of the company. We first compute for each vertex i the values posdf(i) and posbf(i) , the positions (from 1 to n) of vertex i in the DF and BF orderings (i.e. df (posdf(i))=i and bf(posbf(i))=i ). W e now present a linear (O(n)) algorithm solving this problem. We compute a value parent(i) for each vertex i. Initially, all the parent values are s et to 0. At the end of the algorithm, only the root vertex r (obviously, r=df(1)=bf (1)) will have parent(r)=0 and the parent values will define a tree structure which is consistent with the given DF and BF orderings. The main function of the algorithm is the function Compute , which has four pa rameters : v , df_max_pos , bf_min_pos and bf_max_pos . The first call will be Compute(r, n, 2, n) . We will consider that df(n+1)=bf(n+1)=0 . Compute(v, df_max_pos, bf_min_pos, bf_max_pos ): if (( po sdf(bf(bf_min_pos ))≤ df_max_pos ) and ( posdf(bf(bf_min_pos ))>posdf(v) ) and ( parent(bf(bf_min_po s))=0) ) then parent(bf(bf_min_p os))=v last_son=bf(bf_min _pos) ; pos_last_son=bf_ min_pos for i= bf_min_pos +1 to bf_max_pos do if (( posdf(bf(i))≤ df_max_po s ) and ( posdf(bf(i))>posdf(v) ) and ( parent(bf(i))=0 ) a nd ( posdf(bf(i))>posdf(bf(i- 1)) ) and ( bf(i)>bf(i- 1) ) then parent(bf(i))=v last_son=bf(i) ; pos _last_son =i Compute ( bf(i-1),posdf(bf(i))-1 ,posbf(df(posdf(bf(i-1) )+1)) ,n ) else break // break the loo p i=posbf(df(posdf(last_son) +1)) if ( i>pos_last_son ) then Compute ( last_son, df_max_pos, i, n ) else return 6 Related Work We are not aware o f any other attempts of inferring a company’s stru cture based only on the number of pairs of employees having a certa in propert y. Inferring hierachical structures based on several types of tree traversals h as been achieved before, particularly for binary trees [2,3]. 7 Conclusions and F uture Work In this paper we presented severa l algorithmic techniques for inferring the structure of a c ompany (department structure, communication graph, hi erarchy) using very limited available infor mation. In most situations, the inferred structure is only on e of the man y possible structures which are consis tent with the given input data, but, even so, it ma y be useful for performing a more insightful, in-depth analysis of the company. References [1] T. H. Cormen, C. E. Leiserson, R. L. Rivest, „Introduction to Algorithms”, Ed. Mc -Graw Hill, 2002. [2] W . Slough, K. Ef e, „Efficient Algorithms for Tree Reconstruction”, BIT Nu merical Mathematics , vol. 29 (2), pp. 361-363, 1989. [3] A. Andersson, S. C arlsson, „ Construction of a Tree from its Traversals in Optimal Time and Space ”, Information Processing Letters , vol. 34 (1), pp. 21-25, 1990.
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment