You are an expert at summarizing long articles. Proceed to summarize the following text: 
graphs appear in many current applications . in social sciences groups of people are often modeled by letting the vertices in the graph represent persons and edges represent the interactions or relationships between them . edges can be directed or undirected , the later indicating a reciprocal relationship between the vertices . usually the graphs created from such datasets are simplifications of the original dataset . one typical simplification is to allow only directed or only undirected edges . however , in real world graphs it is common to find a combination of directed and undirected edges . in @xcite we find some examples of empirical graphs where the proportion of directed edges is in the range 0.26 - 0.85 , the rest being undirected edges . additional examples are shown in _ table [ tab : directed ] _ where the proportion of directed edges has been calculated for some social networks that can be found in @xcite . we expect such graphs to be better represented by _ partially directed graphs _ , where we allow both directed and undirected edges . .proportion of directed edges for some data sets from @xcite , when viewed as partially directed graphs . we see that several of these graphs have a substantial proportion of undirected edges and of directed edges , such that neither type should be ignored . [ cols="<,>,>,>",options="header " , ]     the _ configuration model _ has been used extensively to model undirected networks @xcite . it has also been been adapted to work for directed graphs @xcite . in the configuration model the graph is constructed by first assigning a degree to each vertex of the graph and then connecting the edges uniformly at random . the degrees of the vertices of the graph are either given as a degree sequence or the degrees are drawn from some given degree distribution . graphs created in this way will share some properties with real world graphs , but will be different in other aspects . e.g. the configuration model for directed networks will have a very low proportion of reciprocal edges , i.e. two parallel directed edges in opposite directions . this is an effect of connecting edges uniformly at random in this type of graph . this can be undesirable if we wish to use the configuration model graph as a _ null reference _ to compare with a real - world graph . while we wish to connect the edges uniformly at random , we may want to preserve the degree distribution , including any dependence between the indegrees , outdegrees and undirected degrees . in this paper we consider a partially directed configuration model where we allow both directed and undirected edges . any vertex in such a partially directed configuration model graph can have all three types of edges : _ incoming _ , _ outgoing _ and _ undirected_. we select the degree of each vertex from a given joint , three dimensional degree distribution and we do not assume or require the in- , out- and undirected degrees to be independent . when connecting the edges , outgoing edges can only connect to incoming edges and undirected edges can only connect to undirected edges . once all edges are connected we make the graph _ simple _ and thus do not allow self loops or parallel edges of any type . we make the graph simple by erasing conflicting edges and by converting parallel undirected edges in opposite directions into undirected edges . since this process modifies the degree of some of the vertices , it is not certain that the empirical degree distribution converges to the degree distribution we started with . however , in _ section [ sec : mainresults ] _ we show that , with suitable restrictions on the first moments of the degree distribution , the degree distribution asymptotically converges to the desired one . note that , by selecting a joint degree distribution in the proper way we can also create completely directed graphs or completely undirected graphs , with or without any dependence between the degrees . thus the presented partially directed configuration model incorporates several of the already existing models .    in the next section , _ section [ sec : mainresults ] _ , we present definitions and state the main result of the paper . detailed derivations and proofs have been postponed to _ section [ sec : proofs]_. to illustrate how these graphs work , _ section [ sec : examples ] _ is devoted to some simulations of partially directed graphs , showing results for small and for large @xmath0 . the latter is to give an intuitive feeling for the asymptotic results and the former is to illustrate that significant deviations from these asymptotic results are possible for small @xmath0 . a comparison with an empirical social network is also done . conclusions and discussion can be found in _ section [ sec : concl]_. in this section we define the configuration model for partially directed graphs . we define the terminology used , how the graph is created from a degree distribution , how the graph is made simple and finally show , with suitable restrictions on the first moments of the degree distribution , that the degree distribution of the partially directed configuration model graph asymptotically converges to the desired distribution . proofs are left for _ section [ sec : proofs ] _      a graph consists of vertices and of edges . the size of the graph , the number of vertices , is denoted @xmath0 . here we will specifically study the case when @xmath1 . we work with graphs that are _ partially directed _ , meaning that any vertex can have incoming edges , outgoing edges and undirected edges . we distinguish between edges and _ stubs_. by stubs we mean yet unconnected half - edges of a vertex . in the same way as edges , stubs can be in - stubs , out - stubs and undirected stubs . the number of stubs of the different types is the degree of a vertex and will be denoted @xmath2 , where the individual terms represent the indegree , outdegree and undirected degree , respectively . when the degree of the vertex is a random quantity , it is denoted @xmath3 . a degree sequence that is non random is denoted @xmath4 , @xmath5 , where @xmath0 is the number of vertices in the graph . when these degree sequences are random vectors they are denoted @xmath6 . degrees can be assigned to the vertices from some given joint degree distribution with distribution function @xmath7 for which the probability of a specific combination of indegree , outdegree and undirected degree is called @xmath8 . we will also use the marginal distributions . we have @xmath9 for the incoming edges , @xmath10 for the outgoing edges and @xmath11 for the undirected edges . the corresponding random variables , i.e. the number of edges of each type , will be denoted @xmath12 , @xmath13 and @xmath14 . other quantities of interest are the moments of the distribution . here we will consider the first moments @xmath15=\sum i{p^{\leftarrow}}_{i } $ ] , @xmath16=\sum j{p^{\rightarrow}}_{j } $ ] and @xmath17=\sum k{p^{\leftrightarrow}}_{k } $ ] . a graph is _ simple _ if there are no unconnected stubs , no self - loops and no parallel edges .    for a finite graph of size @xmath0 we also want to count the number of vertices with a certain degree @xmath18 . we call this quantity @xmath19 . dividing by @xmath0 we can calculate @xmath20 , the proportion of the number of edges that have degree @xmath18 . whenever the graph is created by some random process , we can also consider the expectation of this random quantity @xmath21 $ ] , which defines the distribution function @xmath22 .      we define the partially directed configuration model as follows :    1 . we start with a graph with @xmath0 vertices , but without any edges or stubs . 2 .   for each vertex , we independently draw a degree @xmath23 from @xmath7 at random . we connect undirected stubs with other undirected stubs . we do this by picking two undirected stubs uniformly at random and connecting them . we repeat this with the remaining unconnected undirected stubs until there is at most one undirected stub left . we connect directed incoming stubs with directed outgoing stubs . we do this by picking one directed incoming stub and one directed outgoing stub , both independently and uniformly at random and then connecting them . we repeat this with the remaining unconnected directed stubs until we are out of incoming stubs or outgoing stubs ( or both ) . we want the graph to be simple , but the connection process may have left some stubs unconnected and may also have created self - loops and parallel edges . we make the graph simple by erasing some stubs and edges . we define the procedure in such a way that the connectivity of the graph is maintained : 1 . erase all unconnected stubs . there can be at most one unconnected undirected stub , while there may be a larger number of unconnected directed stubs , either all incoming or all outgoing , if the number of in - stubs is not equal to the number of out - stubs . 2 .   erase all self - loops , both directed and undirected . 3 .   when there are parallel _ identical _ edges , erase all except one of them . 4 .   erase all directed edges that are parallel to an undirected edge . erase each pair of reciprocal directed edges and add a single undirected edge instead . while this step decreases the number of directed edges , it also increases the number of undirected edges .    from the above description we see that there are two non - deterministic steps that affect the degrees of the vertices in the creation of the simple partially directed graph :    1 .   assigning degrees from the distribution @xmath7 . 2 .   connecting the stubs uniformly at random . while this does not , in itself , modify the degrees of the vertices , it affects which stubs and edges that will be erased when making the graph simple . this process results in a finite graph for which the value of @xmath24 had been closer to 2 , then the average number of deleted stubs would not have decreased as clearly as it does now , indicating that the average number of deleted edges then decreases only slowly with the graph size . this still would not in itself contradict convergence in distribution since a large proportion of the deleted edges can then be contributed to a small number of vertices of high degree , and so would not affect the overall convergence of the degree distribution.ch the degree distribution can not be expected to be the same as @xmath7 . however , we later show that , with suitable restrictions on the distribution @xmath7 , the distribution @xmath22 that was defined above , asymptotically approaches @xmath7 . the results in this section are inspired by , and to some degree follow @xcite . the theorem establishes the asymptotic convergence of the degree distribution . [ thm : distribution ] if @xmath7 has finite mean for each component , so @xmath25 , @xmath26 , and @xmath27 , and also @xmath28 then , as @xmath1    1 . @xmath29 , 2 . @xmath30 , that is , the empirical distribution converges in probability to f.    the proof , which is postponed to _ section [ sec : proofs ] _ , follows the same line of reasoning as in @xcite , but with modifications to take into account the complications introduced by allowing both directed and undirected edges in the graph . although _ theorem [ thm : distribution ] _ establishes the asymptotic convergence of the degree distribution , it remains to see how how well this holds for finite graphs . in this section we investigate this by looking at a scale - free distribution , at a poisson degree distribution and at an empirical network . since we are working with a joint degree distribution , in addition to the distribution for each of the three stub types we also need to consider the possible dependence between the different types . _ table [ tab : examples ] _ gives an overview of how the data for the plots were created . @p0.09p0.48p0.16p0.16@    degreedistribution & method & independent & dependent +    empirical & empirical degree data from the dataset @xcite was used . this is data from an on - line social site . some characteristics can be found in _ table [ tab : directed]_. the mean degrees for in - degrees , out - degrees and undirected degrees are 3.6 , 3.6 and 10.6 , respectively ( not shown ) . when viewed as a directed graph and counting all stubs this gives a total mean degree of approximately 28.3 . here we count the undirected edges as two edges since it consists of an incoming and an outgoing edge , when viewed as an edge in a directed graph . both the directed and the undirected edges have degree distributions that are _ approximately _ scale - free in the tail , with @xmath31 and @xmath32 ( not shown ) . & each stub type is treated individually and independent samples are drawn , with replacement , for each vertex and each stub type . & independent samples of complete vertices are drawn , with replacement , from the pool of empirical vertices . +    scale - free & the selected distribution function is @xmath33 with @xmath34 where @xmath35 is the riemann zeta function . the tail of this distribution is asymptotically @xmath36 . this specific distribution function was selected because of its scale - free property , while still being easy to simulate from using a discrete variant of the inverse transformation method ( * ? ? ? * see section 11.2.1 and also example 11.7 ) ) . for all simulations @xmath37 , which is the coefficient for the directed edges in the empirical graph . this value gives finite expectation ( approximately 2.7 ) , but infinite variance . this is consistent with the assumptions in _ theorem [ thm : distribution]_. & for each vertex and each stub type an independent sample from the assigned distribution was drawn . & for each vertex an independent sample from the assigned distribution was drawn and the same degree was assigned to all stubs for the vertex . +    poisson & degrees drawn from poisson distribution with parameter 7 , thus having mean degree 7 . when treated as a directed graph and counting all stubs the total mean degree is 28 , close to the value 28.3 for the empirical graph above . & see above . & see above . +    since _ theorem [ thm : distribution ] _ focuses on showing convergence to the correct degree distribution , studying the total variation distance , @xmath38 ( defined in _ section [ sec : totvardist ] _ ) , is of interest ( see e.g. @xcite ) . we also study the number of erased edges as a function of the graph size . finally , we study the size of the strongly connected giant component and the distribution of small components for a few different graphs based on the empirical data from livejournal . the dataset livejournal1 @xcite is a directed graph created from the declaration of friends in a social internet community . the original graph contains self loops , but these have been removed in this analysis . the simple graph has a proportion of directed edges of about 0.4 , so this is a good example of a graph where both directed and undirected edges play an important role . when sampling from this distribution to create the configuration model graph , the degrees of vertices from the original ( partially directed ) graph were drawn independently and uniformly at random , with replacement . thus the frequencies of the degrees found in the graph were used as the given distribution @xmath7 and this distribution function is then compared with the distribution @xmath22 created by sampling from @xmath7 , connecting the edges and making the graph simple .      _ theorem [ thm : distribution ] _ states that @xmath30 and thus we define the following version of the total variation distance : @xmath39 where the @xmath40 is introduced so that @xmath38 can only take on values in the range @xmath41 $ ] . as @xmath1 we expect to see that the total variation distance tends towards zero . when we generate the graphs according to the configuration model we replace @xmath19 with the corresponding empirical sample @xmath42 from one realization of a random graph . we can then repeat this process with more samples of random graphs and plot this . the result is shown in _ figure [ fig : totvardist ] _ , where we have also taken the average of the empirical total variation distance for 100 random graph samples .        in _ figure [ fig : totvardist ] _ we see that the total variation distance decreases towards zero . the fastest decrease is for the poisson graph , and the reason is that this distribution has a light tail when compared with the scale - free distribution . a closer look att the empirical graph reveals that the distributions for the directed and the undirected edges look much like a scale - free distribution . the in- and the out - degree have @xmath43 and the undirected degree has @xmath44 in the tail ( not shown ) . thus the tail for the empirical distribution is heavier than for the poisson distribution and so we can expect a slower convergence for the empirical graph . even slower convergence has been observed ( not shown ) for values of @xmath24 even closer to 2 , e.g. try @xmath45 . this is not surprising as the distribution then becomes more heavy - tailed . if we continue even further , to @xmath46 the conditions used in the proof of _ theorem [ thm : distribution ] _ no longer hold , since the expectations are no longer finite , and thus we should not expect the total variation distance to converge to zero for these values of @xmath24 .    from the figure we also see that the _ dependent _ curve for the poisson distribution is clearly lower than the _ independent _ curve . one explanation for this is that when the degrees for in - stubs and the out - stubs are identical for each vertex , as in the dependent graph ( as defined in _ table [ tab : examples ] _ ) , the total number of in - stubs will be equal to the total number of out - stubs and thus no directed stubs will be deleted for this reason . there may still be self - loops and parallel edges , but for the poisson graph these are few compared to the number of stubs deleted in the independent graph ( as defined in _ table [ tab : examples ] _ ) where there is a mismatch between the number of in - stubs and the number of out - stubs . for the empirical graph and for the scale - free graph the same phenomenon can not be observed . one explanation to this is that the scale - free independent model is not dominated by the deletion of leftover directed edges . instead the number of self - loops and parallel edges are of the same order of magnitude as the leftover directed edges ( see _ figure [ fig : reldeledges ] _ ) . thus the difference between the curves for the total variation distance is much smaller for the scale - free and for the empirical graph . another answer to why the empirical graph does not show a big difference between the dependent and the independent curve can be that the dependent version of the empirical graph does not have the same type of complete dependence as for the scale - free or the poisson graph . in the empirical dependent graph , degrees are assigned by sampling the degrees of vertices from the original empirical graph , and thus the number of in - stubs will in general not equal the number of out - stubs . looking at _ figure [ fig : reldeledges ] _ we see that the number of directed unconnected edges is almost the same for the independent version as for the dependent version of the empirical graph . looking instead at the same plot for the poisson graph we note that the deletion of directed unconnected stubs dominates the independent version of the graph , while there are no such deleted stubs in the dependent version of the graph . 0.48 , for the po(7 ) model and for the empirical configuration model . each data point shows the average of 100 simulations.,title="fig:",scaledwidth=100.0% ]       0.48 , for the po(7 ) model and for the empirical configuration model . each data point shows the average of 100 simulations.,title="fig:",scaledwidth=100.0% ]       0.48 , for the po(7 ) model and for the empirical configuration model . each data point shows the average of 100 simulations.,title="fig:",scaledwidth=100.0% ]       0.48 , for the po(7 ) model and for the empirical configuration model . each data point shows the average of 100 simulations.,title="fig:",scaledwidth=100.0% ]       0.48 , for the po(7 ) model and for the empirical configuration model . each data point shows the average of 100 simulations.,title="fig:",scaledwidth=100.0% ]       0.48 , for the po(7 ) model and for the empirical configuration model . each data point shows the average of 100 simulations.,title="fig:",scaledwidth=100.0% ]    the number of erased edges will depend on the degree distribution , on the graph size and will also be different each time a graph is created according to the configuration model . in _ figure [ fig : reldeledges ] _ the average number of erased edges per vertex were plotted . each point corresponds to the average of 100 simulations of random graphs according to the partially directed configuration model . the deleted edges were classified as to the reason why they were deleted as defined in the rules in _ section [ sec : creatinggraph]_.    for all plots , the graphs indicate that the average number of deleted stubs or edges per vertex decreases with the size of the graph . thus also the risk of any vertex having its degree affected by the deletion of a stub or an edge goes down and this indicates that the degree distribution @xmath22 converges to @xmath7 asymptotically . the scale - free distribution is more difficult since for @xmath46 neither the variance nor the expectation exist . here we have selected @xmath37 for the scale - free graph . this value gives finite expectation , but infinite variance .    as already briefly mentioned in _ section [ sec : totvardist ] _ , for the scale - free and for the poisson curves there are no deleted directed stubs for the dependent plots . this is because of how the dependent graphs are created . in these graphs , each vertex has the same number of in - stubs and out - stubs . thus there will not be any directed stubs left over after the graph has been connected so no such stubs will be deleted . for the empirical graph this is not the case since the dependent version of the graph is created by sampling from the empirical degrees of the vertices , and for these the number of in - stubs in general do not equal the number of out - stubs . in fact we note that the average number of deleted directed stubs per vertex seem to be approximately equal for the directed and the undirected version of the empirical graph , possibly indicating a quite poor correlation between in - stubs and out - stubs in the original graph . another difference between the graphs is that for the scale - free dependent graph there are many more deleted directed reciprocal edges , deleted directed self loops and deleted directed edges that are parallel with undirected edge , compared with the independent scale - free graph . this can be explained by the heavy tail of the scale - free distribution . for instance assume that some vertex has a very high degree . since the degrees are dependent ( equal , in this case ) , the risk is much higher that there will be self loops among the directed edges . also , since the undirected degree will also be high for this vertex , the risk of having directed edges in parallel with the undirected edges also increases . finally the chance of getting reciprocal directed edges also increases . this risk is high if there are many vertices with high degrees . in the dependent case if two vertices have many in - stubs both will also have many out - stubs , increasing the chance of parallel edges between these .      ) .,scaledwidth=70.0% ]    finally we study the strongly connected components in the original data from livejournal , compared with the configuration model based on partially directed stubs and also on directed stubs . for any vertex @xmath47 we define the out - component of vertex @xmath47 as the set of all vertices that can be reached from vertex @xmath47 by following the edges of the graph and respecting how they are directed . in the same way the in - component of vertex @xmath47 is defined as the set of all vertices from which we can reach vertex @xmath47 . the intersection of the out - component and the in - component defines the strongly connected component of vertex @xmath47 . any two vertices @xmath48 where we can reach @xmath49 from @xmath47 and @xmath47 from @xmath49 have the same strongly connected component . thus the graph can be uniquely divided into a set of strongly connected components . here we study the strongly connected components of the empirical graph and also of configuration model graphs created by using the degree sequence of the empirical graph as the given degree distribution . the largest component in the graph corresponds to the notion of a giant component , the size of which is proportional to the size of the graph . the size of the giant component for these simulations can be compared with theoretical results for a configuration model graph with given degree distribution ( see @xcite ) . by plugging in the empirical degree distribution of the livejournal dataset , we get that the theoretical size of the giant component 0.8040 for the partially directed graph , and 0.8028 for the directed graph . these values show a good match with the simulation data presented in _ figure [ fig : components]_.    it is not surprising that the largest component is largest in the configuration model for the partially directed graph . the original empirical graph is likely to have sub - communities that may connect only weakly to other communities , thus reducing the total size of the largest strongly connected component , but of course increasing the number of moderately sized strongly connected components . the directed graph lacks the undirected edges and thus the largest strongly connected component will not include vertices that are connected to it only via a directed edge ( in one direction only ) . thus its largest strongly connected component will be smaller than for the partially directed graph . when looking at the variation in size among the medium sized components in _ figure [ fig : components ] _ , this is largest for the original empirical graph . for the configuration model on the directed graph _ all _ other components consist only of single vertices , while for the configuration model on the partially directed graph components of size 1 - 4 exist . the appearance of some larger small components for the partially directed graph is caused by the undirected edges , compared with only directed edges for the completely directed graph , as was already mentioned above . in this section we provide a proof of _ theorem [ thm : distribution]_. the first part of the proof closely follows @xcite , with modifications for the joint distribution . in @xcite the proof is for the undirected graph , and the addition of the directed edges makes things more complicated . there are mainly two things that need more detailed treatment , the 3-dimensional degree distribution and the fact that combining undirected and directed edges in the same graph creates new reasons for why edges are erased , affecting the empirical degree distribution and thus also , possibly , the asymptotic behavior of it . the first part of the proof , that is similar to @xcite has been moved to two lemmas ( _ lemma [ lem : b - a ] _ and _ lemma [ lem : sufficient ] _ ) to make the part of the proof that is specific for the partially directed configuration model graph more accessible . a third lemma ( _ lemma [ lem : convergence ] _ ) that helps in the final part of the proof of _ theorem [ thm : distribution ] _ has also been included . [ lem : b - a ] @xmath30 implies @xmath29 as @xmath1 . a.   @xmath50 and @xmath51 imply @xmath52\to p_{{\underline{d } } } $ ] , by bounded convergence @xcite . b.   @xmath52=p_{{\underline{d}}}^{(n ) } $ ] implies @xmath53 c.   since ( ii ) is valid for any @xmath18 we have @xmath29 as @xmath1 .    in _ lemma [ lem : sufficient ] _ we need a few definitions that are used both in the lemma and in the proof of it . let @xmath54 be an indicator variable that shows if vertex @xmath55 has had its degree modified in the process of creating a simple configuration model graph of size @xmath0 . the total number of modified vertices can then be calculated by summing all of these and we define @xmath56 .    [ lem : sufficient ] if @xmath57 and for arbitrary @xmath55 , then @xmath50 as @xmath1 . a.   let @xmath58 be the number of vertices with degree @xmath18 before any stub has been erased or added . by the law of large numbers we have that @xmath59 as @xmath1 . since we want to show that @xmath50 it is enough to show that @xmath60 as @xmath1 . b.   we note that modifying the degree of a vertex affects not only the number of vertices with the original degree , but also the number of vertices with the new degree , thus @xmath58 can be less than @xmath19 . however , we can still be sure that @xmath61 . we wish to show that @xmath62 , i.e. that @xmath63 as @xmath64 . c.   using markov s inequality and that @xmath65 we get @xmath66}{\epsilon};\forall\epsilon>0.\ ] ] thus it is enough to show that @xmath67\to 0 $ ] . d.   the @xmath68 are identically distributed since the numbering of the vertices is arbitrary and so @xmath69={\mathrm{e}}\left[{m_{1}^{(n)}}\right]={\mathrm{p}}\left({m_{1}^{(n)}}{=}1\right ) $ ] , where vertex 1 has been chosen arbitrarily . we want to show that @xmath70 or , equivalently , that @xmath71 as @xmath1 . e.   conditioning on the degree of vertex 1 gives @xmath72 since we know @xmath73 it is enough to show that @xmath74    [ lem : convergence ] let @xmath75 be a sequence of non - negative random variables and let @xmath76 be a non - negative random variable . also let @xmath77 be a real number . if @xmath78 , @xmath79\leq a $ ] and @xmath80=a $ ] , then @xmath79=a $ ] .     for non - negative random variables @xmath81 fatou s lemma states @xmath82\leq \liminf_{m\to\infty}{\mathrm{e}}\left[y_m\right].\ ] ] we apply skorokhod s representation theorem and can thus define @xmath81 and @xmath83 ( all on the same probability space ) to have the same distribution as @xmath75 and @xmath76 , and @xmath84 as @xmath85    developing the left and right hand side of fatou s lemma now gives :    @xmath86 = { \mathrm{e}}[y]={\mathrm{e}}[x]=a,\ ] ]    @xmath87\leq\lim_{n\to\infty}{\mathrm{e}}[y_m]=\lim_{m\to\infty}{\mathrm{e}}[x_m]\leq a.\ ] ]    thus @xmath88=a\ ] ]    now we are ready to prove the main theorem .       1 . _ lemma [ lem : b - a ] _ shows that _ theorem [ thm : distribution ] _ _ ( b ) _ implies _ ( a)_. 2 . it remains to prove _ theorem [ thm : distribution ] _ _ ( b)_. _ lemma [ lem : sufficient ] _ simplifies this process . + let @xmath89 be the _ indicator _ variable for the event that a specific vertex ( arbitrarily selected to be vertex 1 ) has had its degree _ modified _ when creating a simple configuration model graph of size @xmath0 according to the procedure defined in _ section [ sec : creatinggraph]_. also let the degree of vertex 1 be @xmath90 . according to _ lemma [ lem : sufficient ] _ , in order to prove ( b ) it is sufficient to show that @xmath91 3 .   remembering that we do not allow self loops or parallel edges , @xmath92 exactly when each stub from vertex 1 is saved . in total , vertex 1 has @xmath93 stubs and these are all saved only when all of them successfully attach to other matching stubs , all from different vertices selected from vertices @xmath94 . in all other cases the degree of vertex 1 will surely be modified , giving no contribution to the probability of @xmath95 . + now , if we knew the degrees of all the vertices , it would be easy to calculate the probability of @xmath95 . we do this simply by considering _ all _ events where the stubs of vertex 1 connect to different vertices and then sum all the probabilities of these events . it is thus natural to continue the proof by conditioning on the degrees of vertices @xmath94 . let the degrees of vertices @xmath94 be @xmath96 , where the @xmath23 are i.i.d . from @xmath7 . then we want to study @xmath97 . \label{eqn : saveprob}\ ] ] 4 . we now look more closely at the conditional probability @xmath98 + where @xmath99 is a specific outcome of the degrees of the vertices . from this we see that the total number of stubs of each type are @xmath100 , @xmath101 and @xmath102 . we want to know where each stub of vertex 1 _ attempts _ to connect and define a set set of indices , @xmath103 , @xmath104 and @xmath105 . any set of values of these indices we call a _ save - attempt _ , indicating that we try to save all stubs of vertex 1 from being erased , by attempting to connect the stubs of vertex 1 to matching stubs from the vertices pointed to by these indices . + given the degrees of all vertices we can calculate the probability of any such _ save - attempt_. first some basic observations : 1 .   if any one of the selected vertices do not have a matching stub the probability of the _ save - attempt _ is zero . as an example , assume that an in - stub attempts to connect to vertex 2 , but vertex 2 does not have any out - stub at all . then this event will have probability zero . 2 .   as a consequence , for the _ save - attempt _ to have a probability larger than zero , _ all _ the vertices that the stubs of vertex 1 attempt to connect to must have matching stubs . + as an example , take a look at the _ save - attempt _ where each stub of vertex 1 tries to connect to the other vertices in order . the indices then take on the values @xmath106 . for now , we ignore the probability that there may not be enough matching stubs of vertices @xmath107 to accommodate all the stubs of vertex 1 . we do this now to make the main argument clearer , but we correct the equations for this special case later in the proof . + first we look at in - stub 1 from vertex 1 . since we are working with the configuration model , this stub has an equal chance of connecting to any of the matching stubs . thus the probability of in - stub 1 from vertex 1 to connect to any of the out - stubs from vertex 2 is @xmath108 + once in - stub 1 of vertex 1 has connected to vertex 2 we continue with in - stub 2 of vertex 1 . once again the configuration model tells us that this stub has an equal chance of connecting to any of the remaining matching stubs . thus the probability of it connecting to any of the out - stubs from vertex 3 is @xmath109 + we can continue in the same way with the rest of the in - stubs , then the out - stubs and finally the undirected stubs of vertex 1 . for the undirected stubs we note that we need to subtract 2 stubs every time we connect one stub , since the undirected stubs connect to other undirected stubs . + now we can calculate the probability of this specific _ save - attempt _ and find that it is @xmath110 + in the expression we have ignored that we we have already used up @xmath111 out - stubs when connecting the in - stubs of vertex 1 . we correct for this in the final expressions given later in the proof . + here we explicitly see that this expression is equal to zero iff any one of the degrees in the numerator is zero . otherwise it will be positive , but always less than or equal to 1 . + to shorten the expressions we will call each of the three parts of _ eq . ( [ eqn : specprob ] ) _ @xmath112 , @xmath113 and @xmath114 , respectively , where the arrow indicates what type of stub in vertex 1 we are dealing with . + now we are ready to write down the expression for the conditional probability in _ eq . ( [ eqn : condprob ] ) _ we need to sum _ eq . ( [ eqn : specprob ] ) _ over _ all _ values of @xmath115 , @xmath116 and @xmath117 , such that _ all _ sub - indices are different - pointing to different vertices . we arrive at @xmath118 + the number of terms in the sum will be @xmath119 , which is simply the number of different ways in which we can select the @xmath120 indices out of the @xmath121 possible vertices . note that these combinations of indices include the ones we are interested in , where all stubs of vertex 1 are saved . note also that the sum includes some combinations that we are not interested in , but all of these have probability zero and so it does not matter if we include them in the sum or not . 5 . we now need to deal with a few complications that will lead to corrections to @xmath112 , @xmath113 and @xmath114 if the number of stubs of vertex 1 ( @xmath120 ) is larger than the number of available nodes ( @xmath121 ) , then it is not possible to select all sub - indices indices different . however , since @xmath120 is fixed , this is always resolved as @xmath1 . in the following we will always assume that @xmath122 . 2 .   there may be a mismatch in the number of stubs . if the number of undirected stubs is odd , there will be one extra stub . let @xmath123 be the number of such stubs . clearly @xmath123 can only be 0 or 1 . + in the same way the number of in - stubs may differ from the number of out - stubs . let @xmath124 , the difference between the number of in - stubs and the number of out - stubs . clearly @xmath125 can be negative , zero or positive . if @xmath123 or @xmath125 are not zero then some stubs will remain unconnected . + in the following we will deal with both of these by imagining two extra _ pools _ of edges each of size @xmath123 and @xmath126 , respectively . these pools behave just as any normal vertex and any stub has an equal probability to connect to any allowed stub , including these two pools . they are thus added to the denominators in _ eq . ( [ eqn : specprob ] ) _ 3 . as mentioned before , we have included some events that have probability zero in the sum . although the nominator is always zero for these , in some special cases the denominator may also become zero . this happens when there are not enough matching stubs to accommodate all the stubs of vertex 1 . of course we could define @xmath127 , but here we instead chose to correct the denominator so that it does not become zero . we do this correction by adding an extra indicator variable to the denominator . whenever this happens , the nominator is still zero , so the sum is not changed . + the corrected versions of @xmath112 , @xmath113 and @xmath114 are thus @xmath128 6 .   to be able to obtain an expression for the probability in _ eq . ( [ eqn : condprob ] ) _ we need to replace the degrees in _ eq . ( [ eqn : corrspecprob ] ) _ with their stochastic counterpart to obtain @xmath129 where @xmath130 here the uppercase variables are all the stochastic counterparts of the lowercase variables defined previously . 7 . now we can continue with _ eq . ( [ eqn : saveprob ] ) _ : @xmath131        \\        & = { \mathrm{e}}\left [ \sum_{\substack{{\mathbf{i}},\ , { \mathbf{j}},\ , { \mathbf{k}}\\ \text{all sub - indices different}}}{{q^{\overset{(n)}{\leftarrow}}_{{\mathbf{i}}}}{q^{\overset{(n)}{\rightarrow}}_{{\mathbf{j}}}}{q^{\overset{(n)}{\leftrightarrow}}_{{\mathbf{k } } } } } \right ]        \\        & = \sum_{\substack{{\mathbf{i}},\ , { \mathbf{j}},\ , { \mathbf{k}}\\ \text{all sub - indices different}}}{{\mathrm{e}}\left [ { q^{\overset{(n)}{\leftarrow}}_{{\mathbf{i}}}}{q^{\overset{(n)}{\rightarrow}}_{{\mathbf{j}}}}{q^{\overset{(n)}{\leftrightarrow}}_{{\mathbf{k}}}}\right ] }        \\        & = ( n-1)(n-2)\cdot ... \cdot(n - d){\mathrm{e}}\left [ { q^{\overset{(n)}{\leftarrow}}_{{\mathbf{i}}}}{q^{\overset{(n)}{\rightarrow}}_{{\mathbf{j}}}}{q^{\overset{(n)}{\leftrightarrow}}_{{\mathbf{k}}}}\right ]        \\        & = \frac{(n-1)\cdot ... \cdot(n - d)}{n^{d}}{\mathrm{e}}\left[n^{d}{q^{\overset{(n)}{\leftarrow}}_{{\mathbf{i}}}}{q^{\overset{(n)}{\rightarrow}}_{{\mathbf{j}}}}{q^{\overset{(n)}{\leftrightarrow}}_{{\mathbf{k}}}}\right ]        \\        & = c^{(n ) }        { \mathrm{e}}\left [ \left(n^{{d^{\leftarrow}}}{q^{\overset{(n)}{\leftarrow}}_{{\mathbf{i}}}}\right ) \left(n^{{d^{\rightarrow}}}{q^{\overset{(n)}{\rightarrow}}_{{\mathbf{j}}}}\right )                 \left(n^{{d^{\leftrightarrow}}}{q^{\overset{(n)}{\leftrightarrow}}_{{\mathbf{k}}}}\right ) \right ] . \label{eqn : condprobfinal }      \end{aligned}\ ] ] + _ note 1 : _ the expectation and the summation can be interchanged since all terms are non - negative and since the summation does not depend on any random quantity ( as mentioned before ) . + _ note 2 : _ since vertex degrees are drawn independently at random , all expectation terms in the sum are identical and we simply take the number of terms times the expectation of one of the terms instead of the sum . the number of terms was already discussed above . + _ note 3 : _ all that remains is to take the limit of _ eq . ( [ eqn : condprobfinal])_. we start by studying the limit of what is inside the expectation . rewriting the first term we get @xmath133 + the remaining outgoing and undirected terms will be very similar , producing the additional terms @xmath134 , @xmath135 , @xmath136 , @xmath137 and @xmath138 in the denominator . + now note that , since @xmath139 and @xmath140 , we have that @xmath141}\leq1\ ] ] by the law of large numbers and using slutsky s theorem @xmath142 here we used that @xmath143 , by assumption . + since all @xmath144 , @xmath145 and @xmath146 are independent by construction we also have @xmath147        = 1.\ ] ] now we use _ lemma [ lem : convergence ] _ and immediately conclude that @xmath141}=1\ ] ] and thus also that @xmath148 }        = 1.\ ] ]    this is what we wanted to show and so the proof is complete . we have shown a simple way to create a partially directed configuration model graph from a given joint degree distribution . the graph is simple , and under specified conditions the degree distribution converges to the desired one . the proof is generic and can be extended to any type of graph where stubs are saved from being erased if they connect to other ( unique ) vertices . the only assumptions in the proof are that the degrees of different vertices are independent , that the expectation of the degree of each type of stub is finite and that the expectation of the degree for the in - stubs is equal to the expectation for the degree of the out - stubs . this means that the proof works also for undirected graphs and for directed graphs , and also if the number of different types of stubs is increased to any finite number , as long as similar conditions as in this proof are fulfilled . allowing for self loops and parallel edges only increases the chance of saving a stub from being erased and so is not a problem . the main advantage of using a partially directed model to represent empirical networks , as opposed to using a completely directed or completely undirected model , is that the partially directed model preserves the proportion of undirected edges . this is important for networks where there is a significant proportion both of directed and of undirected edges , and where none of the different types of edges can be ignored . examples of such graphs have been given in _ table [ tab : directed]_. the model also preserves any dependence between directed and undirected degrees present in the original empirical graph or the given degree distribution . however , this model does not produce other structures that can often be found in empirical networks . e.g. it does not produce the same number of moderately sized strongly connected components that we see in the empirical networks . in this respect it does however perform slightly better than the configuration model on directed graphs . possible improvements towards realism would be to see how e.g. triangles ( of different types ) , different types of vertices and other heterogeneities could be included in the model . k.s . was supported by the swedish research council , grant no . 2009 - 5759 . t.b . is grateful to riksbankens jubileumsfond ( contract p12 - 0705:1 ) for financial support .
the configuration model was originally defined for undirected networks and has recently been extended to directed networks . 
 many empirical networks are however neither undirected nor completely directed , but instead usually partially directed meaning that certain edges are directed and others are undirected . in the paper 
 we define a configuration model for such networks where nodes have in- , out- , and undirected degrees that may be dependent . we prove conditions under which the resulting degree distributions converge to the intended degree distributions . 
 the new model is shown to better approximate several empirical networks compared to undirected and completely directed networks .