CN112925951A - Method and device for processing directed weighted graph - Google Patents

Method and device for processing directed weighted graph Download PDF

Info

Publication number
CN112925951A
CN112925951A CN202110183545.0A CN202110183545A CN112925951A CN 112925951 A CN112925951 A CN 112925951A CN 202110183545 A CN202110183545 A CN 202110183545A CN 112925951 A CN112925951 A CN 112925951A
Authority
CN
China
Prior art keywords
weighted graph
directed
directed weighted
graph
loop chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110183545.0A
Other languages
Chinese (zh)
Inventor
李志勇
罗剑平
彭灿
蔡晋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110183545.0A priority Critical patent/CN112925951A/en
Publication of CN112925951A publication Critical patent/CN112925951A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Software Systems (AREA)
  • Accounting & Taxation (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a processing method and a processing device of a directed weighted graph, which can be used for simplifying the directed weighted graph in the financial field. The processing method comprises the following steps: acquiring debt data and debt relations among transaction enterprises; establishing a directed weighting graph based on the debt data and the debt relationship; if the directed weighted graph is a single closed-loop chain, optimizing the directed weighted graph to obtain an open-chain directed weighted graph; and if the directed weighted graph is a complex closed-loop chain, traversing the directed weighted graph through a depth-first algorithm to obtain weighted graphs in at least two single closed-loop chain states, and optimizing the weighted graphs to enable the weighted graphs to be open chains. The invention can simplify the directed weighting graph based on the debt relationship, further reduce the complexity of the debt relationship and better solve the complex relationship such as the debt type.

Description

Method and device for processing directed weighted graph
Technical Field
The invention relates to the field of financial management, in particular to a processing method and device of a directed weighted graph.
Background
In the countries with the most complete industrial varieties in the united nations, production and transaction enterprises are wide in layout, complete in types and numerous in entities. In the production and management, mutual debts are inevitably generated among transaction enterprises, and the debts generated in an industrial chain are easily conducted up and down to form a debt chain. If not handled very easily, systematic risks arise. Therefore, the debt which is an invisible killer buried in economic operation activities is ubiquitous and can become an economic virus tumor through certain accumulation, and the economic social development is seriously influenced.
There are many complex relationships in the real world that can be represented graphically. Charts have penetrated into the study of complex social, biological and technical systems of dimensional data, or dynamic processes of the network, such as the spread of epidemics. In network science, the problem of interest to researchers is not solved by analyzing data, but by analyzing the structure of a graph. The theory behind analyzing and processing signals on the graph is therefore growing. Such as complex debt relationships, may be represented as a kind of directed weighted graph. Therefore, there is an urgent need for a method for solving systematic complex debt relationships through a directed weighted graph.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a processing method and a processing device for a directed weighted graph, which can simplify the directed weighted graph based on the debt relationship and further reduce the complexity of the debt relationship.
In order to solve the technical problems, the invention provides the following technical scheme:
in a first aspect, the present invention provides a method for processing a directed weighted graph, including:
acquiring debt data and debt relations among transaction enterprises;
establishing a directed weighting graph based on the debt data and the debt relationship;
if the directed weighted graph is a single closed-loop chain, optimizing the directed weighted graph to obtain an open-chain directed weighted graph;
and if the directed weighted graph is a complex closed-loop chain, traversing the directed weighted graph through a depth-first algorithm to obtain weighted graphs in at least two single closed-loop chain states, and optimizing the weighted graphs to enable the weighted graphs to be open chains.
Wherein the directed weighted graph comprises at least three nodes and weights between adjacent nodes.
Wherein said optimizing said directed weighted graph to obtain an open-chained directed weighted graph comprises:
performing mutual cancellation processing based on the minimum weight on the directed weighted graph to obtain an open-chain directed weighted graph;
wherein, the single closed-loop chain is that each node on the directed weighted graph has an incoming edge and an outgoing edge; and the open chain is that the first node only has an outgoing edge and the tail node only has an incoming edge on the directed weighted graph.
Wherein, the traversing processing is performed on the directed weighted graph through a depth-first algorithm to obtain at least two weighted graphs in a single closed-loop chain state, and the method comprises the following steps:
starting access from any node A in the directed weighted graph;
sequentially starting from the non-accessed adjacent points starting from the node A, and performing depth-first traversal on the directed weighted graph; until the nodes with paths communicated with the directed weighted graph and the node A are accessed, recording the accessed nodes and the weights between adjacent nodes;
if the nodes in the directed weighted graph are not accessed, accessing is started from any node which is not accessed, and depth-first traversal is performed again until all the nodes in the directed weighted graph are accessed;
and forming a directed path through iterative backtracking to obtain a weighted graph of at least two single closed-loop chain states.
If at least two weighted graphs in the single closed loop chain state have a common edge;
splitting the weighted graphs of the at least two single closed-loop chain states on the common side according to the minimum weight values corresponding to the weighted graphs of the at least two single closed-loop chain states and the weight values corresponding to the common side, and obtaining the weighted graphs of the at least two independent single closed-loop chain states.
In a second aspect, the present invention provides a processing apparatus for a directed weighted graph, including:
the acquiring module is used for acquiring debt data and debt relations among transaction enterprises;
the weighted graph module is used for establishing a directed weighted graph based on the debt data and the debt relation;
the first processing module is used for optimizing the directed weighted graph to obtain an open-chain directed weighted graph if the directed weighted graph is a single closed-loop chain;
and the second processing module is used for performing traversal processing on the directed weighted graph through a depth-first algorithm to obtain weighted graphs in at least two single closed-loop chain states if the directed weighted graph is a complex closed-loop chain, and optimizing the weighted graph to enable the weighted graph to be an open chain.
Wherein the directed weighted graph comprises at least three nodes and weights between adjacent nodes.
Wherein the first processing module comprises:
the counteracting unit is used for carrying out mutual counteracting processing based on the minimum weight on the directed weighted graph to obtain an open-chain directed weighted graph;
wherein, the single closed-loop chain is that each node on the directed weighted graph has an incoming edge and an outgoing edge; and the open chain is that the first node only has an outgoing edge and the tail node only has an incoming edge on the directed weighted graph.
Wherein the second processing module comprises:
the access unit is used for starting access from any node A in the directed weighted graph;
the traversal unit is used for sequentially starting from the non-accessed adjacent points starting from the node A and performing depth-first traversal on the directed weighted graph; until the nodes with paths communicated with the directed weighted graph and the node A are accessed, recording the accessed nodes and the weights between adjacent nodes;
the iteration unit is used for starting to access from any node which is not accessed and performing depth-first traversal again until all nodes in the directed weighted graph are accessed if the nodes in the directed weighted graph are not accessed;
and the backtracking unit is used for forming a directed path through iterative backtracking to obtain at least two weighted graphs in a single closed-loop chain state.
The backtracking unit is further configured to determine whether a weighted graph of at least two single closed-loop chain states has a common edge;
splitting the weighted graphs of the at least two single closed-loop chain states on the common side according to the minimum weight values corresponding to the weighted graphs of the at least two single closed-loop chain states and the weight values corresponding to the common side, and obtaining the weighted graphs of the at least two independent single closed-loop chain states.
In a third aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the processing method of the directed weighted graph when executing the program.
In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for processing a directed weighted graph.
According to the technical scheme, the invention provides the processing method and the device of the directed weighting graph, and the debt data and the debt relationship among transaction enterprises are obtained; establishing a directed weighting graph based on the debt data and the debt relationship; if the directed weighted graph is a single closed-loop chain, optimizing the directed weighted graph to obtain an open-chain directed weighted graph; if the directed weighted graph is a complex closed-loop chain, traversing the directed weighted graph through a depth-first algorithm to obtain weighted graphs in at least two single closed-loop chain states, optimizing the weighted graphs to enable the weighted graphs to be open chains, simplifying the directed weighted graphs based on the debt relations, further reducing the complexity of the debt relations, and better solving the complex relations such as the debt types. A solution is provided for solving systematic complex debt relations.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart illustrating a processing method of a directed weighted graph according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of the compensation of a single closed-loop chain directed weighted graph in the processing method of the directed weighted graph according to the embodiment of the present invention.
Fig. 3 is a schematic diagram of compensation of an open-chain directed weighted graph in the processing method of the directed weighted graph in the embodiment of the present invention.
Fig. 4 is a flowchart illustrating step S104 in the processing method of the directional weighted graph in the embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a complex closed-loop chain in the processing method of the directed weighted graph in the embodiment of the present invention.
Fig. 6 is a schematic structural diagram of a sideline chain in the processing method of the directed weighted graph in the embodiment of the present invention.
Fig. 7 is a schematic structural diagram of a processing apparatus of a directed weighted graph in an embodiment of the present invention.
Fig. 8 is a schematic structural diagram of an electronic device in an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The present invention provides an embodiment of a processing method of a directed weighted graph, and referring to fig. 1, the processing method of the directed weighted graph specifically includes the following contents:
s101: acquiring debt data and debt relations among transaction enterprises;
s102: establishing a directed weighting graph based on the debt data and the debt relationship;
it should be noted that each node in the directed weighted graph is each transaction enterprise, the weight between adjacent nodes is obtained by performing weighted calculation based on the debt data, and the incoming edge and the outgoing edge on each node in the directed weighted graph are the debt relationship between each transaction enterprise.
In this embodiment, the directed weighted graph includes at least three nodes and weights between adjacent nodes.
S103: if the directed weighted graph is a single closed-loop chain, optimizing the directed weighted graph to obtain an open-chain directed weighted graph;
in this step, as shown in fig. 2, for the directed weighted graph of the single closed-loop chain, the number of nodes of the directed weighted graph a is 6(a, B, c, d, e, f), the minimum value of the weight of the edge is 4, and since the single closed-loop chain has an incoming edge and an outgoing edge at each node on the directed weighted graph, the minimum value of the weight 4 can be subjected to mutual cancellation processing, the edges of the directed weighted graph a of the single closed-loop chain become an open-chain directed weighted graph B after mutual cancellation processing; and the open chain is that the first node only has an outgoing edge and the tail node only has an incoming edge on the directed weighted graph.
Wherein, if f (x) is a cancellation function, then f (x) is 6 × 4 ═ 24, i.e. if the number of nodes is a and the minimum weight value is m for any single closed-loop chain a, then the cancellation function f is thatA(x)=am。
It should be noted that, for an open chain, because each node does not have an incoming edge and an outgoing edge (the first node only has an outgoing edge, and the last node only has an incoming edge), automatic cancellation of the weight cannot be achieved.
S104: and if the directed weighted graph is a complex closed-loop chain, traversing the directed weighted graph through a depth-first algorithm to obtain weighted graphs in at least two single closed-loop chain states, and optimizing the weighted graphs to enable the weighted graphs to be open chains.
As can be seen from the above description, the processing method of the directed weighting graph provided in the embodiment of the present invention obtains the debt data and the debt relationship between the transaction enterprises; establishing a directed weighting graph based on the debt data and the debt relationship; if the directed weighted graph is a single closed-loop chain, optimizing the directed weighted graph to obtain an open-chain directed weighted graph; if the directed weighted graph is a complex closed-loop chain, traversing the directed weighted graph through a depth-first algorithm to obtain weighted graphs in at least two single closed-loop chain states, optimizing the weighted graphs to enable the weighted graphs to be open chains, simplifying the directed weighted graphs based on the debt relations, further reducing the complexity of the debt relations, and better solving the complex relations such as the debt types. A solution is provided for solving systematic complex debt relations.
In an embodiment of the present invention, referring to fig. 3, a compensation processing method for an open-chain directed weighted graph is provided, which specifically includes the following steps:
for the open chain, because each node does not have an incoming edge and an outgoing edge (the first node only has an outgoing edge, and the tail node only has an incoming edge), the automatic offset of the weight value cannot be realized. If the head node of the open chain can initiate the weight offset, the weight offset of the whole chain is driven.
And introducing a super node g, wherein the super node g can be connected with any node of the directed weighted graph, and the incoming edge weight of the node comes from the directed weighted graph and is extracted from the weight of each node in a preset mode, such as proportion. As shown in fig. 3:
the left and right sides of the super node g provide a compensation mechanism for the open chain, and the offset effect of the weight of the open chain node can be promoted. The following is exemplified:
the compensation mechanism of real life has certain help for weight cleaning of open chain. For example, when a debt enterprise registers and authenticates to enter a debt network of a bank, the bank draws a part of funds into a debt fund pool of the bank according to the debt condition in proportion (for example, 1%), and when the debt chain is opened and automatic clearing of the debt cannot be realized, debt fund compensation is provided from the fund pool according to the total amount of the chain related to the debt. Then as the head node of the debt chain, a small amount of debt authentication fee is paid, so that the acquiring bank provides debt compensation larger than the fee, which can promote the payment of the debt, and the debt of the debt chain can obtain a certain clearance.
In an embodiment of the present invention, referring to fig. 4, a manner of performing traversal processing on the directional weighted graph through a depth-first algorithm is provided, which specifically includes the following steps:
s1041: starting access from any node A in the directed weighted graph;
s1042: sequentially starting from the non-accessed adjacent points starting from the node A, and performing depth-first traversal on the directed weighted graph; until the nodes with paths communicated with the directed weighted graph and the node A are accessed, recording the accessed nodes and the weights between adjacent nodes;
s1043: if the nodes in the directed weighted graph are not accessed, accessing is started from any node which is not accessed, and depth-first traversal is performed again until all the nodes in the directed weighted graph are accessed;
s1044: and forming a directed path through iterative backtracking to obtain a weighted graph of at least two single closed-loop chain states.
In this embodiment, the key to the directed weighted graph is to identify links, and for the complex directed weighted graph as shown in fig. 5, the directed weighted graph can be traversed by applying a depth-first algorithm (DFS):
all links of the directed weighted graph can be obtained through a depth first algorithm (DFS), wherein some links are closed-loop links, which are called closed links for short, and some links are open links, which are called open links for short.
It should be noted that, in the step S1044, the complex directed weighted graph can be converted into a closed chain and an open chain; the links have a common edge condition, that is, one link includes a node and an edge in the other link.
If at least two weighted graphs in the single closed loop chain state have a common edge;
splitting the weighted graphs of the at least two single closed-loop chain states on the common side according to the minimum weight values corresponding to the weighted graphs of the at least two single closed-loop chain states and the weight values corresponding to the common side, and obtaining the weighted graphs of the at least two independent single closed-loop chain states.
In this embodiment, referring to fig. 6, for links that have a common edge if the weighted graphs of at least two single closed-loop chain states have a common edge, weights on the edges of the common link are distributed in an optimal manner, and a link a (a, m) is defined, where a represents the number of nodes of the link, and m represents the minimum value of the weights on all the edges of the link.
1. The two closed-loop chains are co-chained: a (a, m) and B (B, n), wherein the common side of the A (a, m) and the B (B, n) is L, the weight is L:
(1) when l is larger than or equal to m + n, the weight of the common edge can be directly distributed according to A, B, so as to form two independent closed-loop chains A '(a, m), B' (B, n), and f (x) is am + bn.
(2) When l is more than or equal to m, l is more than or equal to n, and l is less than m + n, the weight of the common edge needs to be distributed in two common chains, and if x is more than or equal to 0 and less than or equal to m, the distributed weight on A is x, and the distributed weight on B is l-x. The revenue function of the weight distribution on the two chains is:
and f (x) ax + b (l-x) ═ a-b) x + bl, wherein x is in a value range of l-n less than or equal to x less than or equal to m. It should be noted that when x > m, the value of m is only a function of m for closed-loop chains. After l guarantees that the B chain is fully assigned n according to its minimum value n, the others should be assigned to the A chain, so the minimum value of x should be l-n. According to the characteristics of the linear function, when a is larger than B, x is equal to m, f (x) has the maximum value, when a is smaller than B, x is equal to l-n, and when a is equal to B, f (x) has the constant bl, i.e. l can be randomly distributed on the A chain and the B chain.
(3) x ∈ [ min (m, n), max (m, n) ], where m > n, then f (x) max (al, bn), and where m < n, then f (x) max (am, bl).
(4) When l < m and l < n, then l is the minimum weight of the A and B chains, and f (x) max (al, bl).
In the case of 2 catenaries discussed above, for the case of 3 catenaries, three closed-loop catenaries are provided: a (a, m), B (B, n) and C (C, k), wherein the common side is L and the weight is L. The revenue priority principle is adopted for the allocation of l, which is specifically as follows:
(1) when l is equal to or greater than m + n + k, f (x) am + bn + ck.
(2) When l is more than or equal to the sum of any two of m, n and k and less than the sum of the m, n and k, if l is more than or equal to m + n and less than or equal to m + n + k, the sizes of am + bn and ck are compared. If am + bn is more than or equal to ck, the point l is distributed to the A and B common chain, and l- (m + n) is distributed to the C chain; if am + bn < ck, then l emphasis is assigned to C chain, and l-k is assigned to A, B co-chain. The rest is processed according to two common chains.
(3) When l is not more than the sum of any two of m, n and k, but l is more than or equal to m, n and k, the sizes of am, bn and ck are compared, and who is large preferentially distributes to who, and the other conditions are similar and are not listed one by one. The remaining co-chains are processed as described above.
The splitting can be performed by recursion in sequence for the case of more than 3 co-chains.
Closed-chain and open-chain co-linkage cases: let closed-loop chains be A (a, m), open-loop chains be B (B, n), their common edges be L, and weight be L, according to the above, L is preferentially allocated to closed-loop chains. In the case of two open chains being co-linked, the assignment is made with reference to the case of two closed chains being co-linked.
An embodiment of the present invention provides a specific implementation manner of a processing apparatus capable of implementing a directed weighted graph of all contents in the processing method of a directed weighted graph, and referring to fig. 7, the processing apparatus of the directed weighted graph specifically includes the following contents:
the acquiring module 10 is used for acquiring debt data and debt relations among transaction enterprises;
a weighted graph module 20, configured to establish a directed weighted graph based on the debt data and the debt relationship;
a first processing module 30, configured to optimize the directed weighted graph to obtain an open-chain directed weighted graph if the directed weighted graph is a single closed-loop chain;
and the second processing module 40 is configured to, if the directed weighted graph is a complex closed-loop chain, perform traversal processing on the directed weighted graph through a depth-first algorithm to obtain weighted graphs in at least two single closed-loop chain states, and optimize the weighted graphs so that the weighted graphs are open-chain.
Wherein the directed weighted graph comprises at least three nodes and weights between adjacent nodes.
Wherein the first processing module comprises:
the counteracting unit is used for carrying out mutual counteracting processing based on the minimum weight on the directed weighted graph to obtain an open-chain directed weighted graph;
wherein, the single closed-loop chain is that each node on the directed weighted graph has an incoming edge and an outgoing edge; and the open chain is that the first node only has an outgoing edge and the tail node only has an incoming edge on the directed weighted graph.
Wherein the second processing module comprises:
the access unit is used for starting access from any node A in the directed weighted graph;
the traversal unit is used for sequentially starting from the non-accessed adjacent points starting from the node A and performing depth-first traversal on the directed weighted graph; until the nodes with paths communicated with the directed weighted graph and the node A are accessed, recording the accessed nodes and the weights between adjacent nodes;
the iteration unit is used for starting to access from any node which is not accessed and performing depth-first traversal again until all nodes in the directed weighted graph are accessed if the nodes in the directed weighted graph are not accessed;
and the backtracking unit is used for forming a directed path through iterative backtracking to obtain at least two weighted graphs in a single closed-loop chain state.
The backtracking unit is further configured to determine whether a weighted graph of at least two single closed-loop chain states has a common edge;
splitting the weighted graphs of the at least two single closed-loop chain states on the common side according to the minimum weight values corresponding to the weighted graphs of the at least two single closed-loop chain states and the weight values corresponding to the common side, and obtaining the weighted graphs of the at least two independent single closed-loop chain states.
The embodiment of the processing apparatus for a directed weighted graph provided in the present invention may be specifically configured to execute the processing procedure of the embodiment of the processing method for a directed weighted graph in the foregoing embodiment, and the functions of the processing apparatus for a directed weighted graph are not described herein again, and refer to the detailed description of the embodiment of the method.
As can be seen from the above description, the processing apparatus for a directed weighting graph according to the embodiment of the present invention obtains the debt data and the debt relationship between the transaction enterprises; establishing a directed weighting graph based on the debt data and the debt relationship; if the directed weighted graph is a single closed-loop chain, optimizing the directed weighted graph to obtain an open-chain directed weighted graph; if the directed weighted graph is a complex closed-loop chain, traversing the directed weighted graph through a depth-first algorithm to obtain weighted graphs in at least two single closed-loop chain states, optimizing the weighted graphs to enable the weighted graphs to be open chains, simplifying the directed weighted graphs based on the debt relations, further reducing the complexity of the debt relations, and better solving the complex relations such as the debt types. A solution is provided for solving systematic complex debt relations.
The present application provides an embodiment of an electronic device for implementing all or part of contents in the processing method of a directed weighted graph, where the electronic device specifically includes the following contents:
a processor (processor), a memory (memory), a communication Interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the communication interface is used for realizing information transmission between related devices; the electronic device may be a desktop computer, a tablet computer, a mobile terminal, and the like, but the embodiment is not limited thereto. In this embodiment, the electronic device may refer to an embodiment of the processing method for implementing the directed weighted graph and an embodiment of the processing apparatus for implementing the directed weighted graph in this embodiment, which are incorporated herein and repeated details are not repeated.
Fig. 8 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 8, the electronic device 9600 can include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this FIG. 8 is exemplary; other types of structures may also be used in addition to or in place of the structure to implement telecommunications or other functions.
In one embodiment, the processing functionality of the directed weighted graph may be integrated into central processor 9100. The central processor 9100 may be configured to control as follows:
acquiring debt data and debt relations among transaction enterprises; establishing a directed weighting graph based on the debt data and the debt relationship; if the directed weighted graph is a single closed-loop chain, optimizing the directed weighted graph to obtain an open-chain directed weighted graph; and if the directed weighted graph is a complex closed-loop chain, traversing the directed weighted graph through a depth-first algorithm to obtain weighted graphs in at least two single closed-loop chain states, and optimizing the weighted graphs to enable the weighted graphs to be open chains.
As can be seen from the above description, the electronic device provided in the embodiments of the present application obtains the debt data and the debt relationship between the transaction enterprises; establishing a directed weighting graph based on the debt data and the debt relationship; if the directed weighted graph is a single closed-loop chain, optimizing the directed weighted graph to obtain an open-chain directed weighted graph; if the directed weighted graph is a complex closed-loop chain, traversing the directed weighted graph through a depth-first algorithm to obtain weighted graphs in at least two single closed-loop chain states, optimizing the weighted graphs to enable the weighted graphs to be open chains, simplifying the directed weighted graphs based on the debt relations, further reducing the complexity of the debt relations, and better solving the complex relations such as the debt types.
In another embodiment, the processing apparatus of the directed weighted graph may be configured separately from the central processor 9100, for example, the processing apparatus of the directed weighted graph may be configured as a chip connected to the central processor 9100, and the processing function of the directed weighted graph is realized by the control of the central processor.
As shown in fig. 8, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 also does not necessarily include all of the components shown in fig. 8; further, the electronic device 9600 may further include components not shown in fig. 8, which may be referred to in the art.
As shown in fig. 8, a central processor 9100, sometimes referred to as a controller or operational control, can include a microprocessor or other processor device and/or logic device, which central processor 9100 receives input and controls the operation of the various components of the electronic device 9600.
The memory 9140 can be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 9100 can execute the program stored in the memory 9140 to realize information storage or processing, or the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. Power supply 9170 is used to provide power to electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, an LCD display, but is not limited thereto.
The memory 9140 can be a solid state memory, e.g., Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 9140 could also be some other type of device. Memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 being used for storing application programs and function programs or for executing a flow of operations of the electronic device 9600 by the central processor 9100.
The memory 9140 can also include a data store 9143, the data store 9143 being used to store data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers for the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, contact book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. The communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby implementing ordinary telecommunications functions. The audio processor 9130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100, thereby enabling recording locally through the microphone 9132 and enabling locally stored sounds to be played through the speaker 9131.
An embodiment of the present invention further provides a computer-readable storage medium capable of implementing all the steps in the processing method of the directional weighted graph in the above embodiment, where the computer-readable storage medium stores thereon a computer program, and when the computer program is executed by a processor, the computer program implements all the steps of the processing method of the directional weighted graph in the above embodiment, for example, the processor implements the following steps when executing the computer program:
acquiring debt data and debt relations among transaction enterprises; establishing a directed weighting graph based on the debt data and the debt relationship; if the directed weighted graph is a single closed-loop chain, optimizing the directed weighted graph to obtain an open-chain directed weighted graph; and if the directed weighted graph is a complex closed-loop chain, traversing the directed weighted graph through a depth-first algorithm to obtain weighted graphs in at least two single closed-loop chain states, and optimizing the weighted graphs to enable the weighted graphs to be open chains.
As can be seen from the above description, the computer-readable storage medium provided by the embodiment of the present invention obtains the debt data and the debt relationship between the transaction enterprises; establishing a directed weighting graph based on the debt data and the debt relationship; if the directed weighted graph is a single closed-loop chain, optimizing the directed weighted graph to obtain an open-chain directed weighted graph; if the directed weighted graph is a complex closed-loop chain, traversing the directed weighted graph through a depth-first algorithm to obtain weighted graphs in at least two single closed-loop chain states, optimizing the weighted graphs to enable the weighted graphs to be open chains, simplifying the directed weighted graphs based on the debt relations, further reducing the complexity of the debt relations, and better solving the complex relations such as the debt types.
Although the present invention provides method steps as described in the examples or flowcharts, more or fewer steps may be included based on routine or non-inventive labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual apparatus or client product executes, it may execute sequentially or in parallel (e.g., in the context of parallel processors or multi-threaded processing) according to the embodiments or methods shown in the figures.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, apparatus (system) or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. The present invention is not limited to any single aspect, nor is it limited to any single embodiment, nor is it limited to any combination and/or permutation of these aspects and/or embodiments. Moreover, each aspect and/or embodiment of the present invention may be utilized alone or in combination with one or more other aspects and/or embodiments thereof.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the present invention, and they should be construed as being included in the following claims and description.

Claims (12)

1. A method for processing a directed weighted graph, comprising:
acquiring debt data and debt relations among transaction enterprises;
establishing a directed weighting graph based on the debt data and the debt relationship;
if the directed weighted graph is a single closed-loop chain, optimizing the directed weighted graph to obtain an open-chain directed weighted graph;
and if the directed weighted graph is a complex closed-loop chain, traversing the directed weighted graph through a depth-first algorithm to obtain weighted graphs in at least two single closed-loop chain states, and optimizing the weighted graphs to enable the weighted graphs to be open chains.
2. The method of claim 1, wherein the directed weighted graph comprises at least three nodes and weights between adjacent nodes.
3. The method of processing a directed weighted graph according to claim 2, wherein the optimizing the directed weighted graph to obtain an open-chain directed weighted graph comprises:
performing mutual cancellation processing based on the minimum weight on the directed weighted graph to obtain an open-chain directed weighted graph;
wherein, the single closed-loop chain is that each node on the directed weighted graph has an incoming edge and an outgoing edge; and the open chain is that the first node only has an outgoing edge and the tail node only has an incoming edge on the directed weighted graph.
4. The method according to claim 2, wherein traversing the directed weighted graph by a depth-first algorithm to obtain weighted graphs of at least two single closed-loop chain states comprises:
starting access from any node A in the directed weighted graph;
sequentially starting from the non-accessed adjacent points starting from the node A, and performing depth-first traversal on the directed weighted graph; until the nodes with paths communicated with the directed weighted graph and the node A are accessed, recording the accessed nodes and the weights between adjacent nodes;
if the nodes in the directed weighted graph are not accessed, accessing is started from any node which is not accessed, and depth-first traversal is performed again until all the nodes in the directed weighted graph are accessed;
and forming a directed path through iterative backtracking to obtain a weighted graph of at least two single closed-loop chain states.
5. The method of claim 4, wherein if at least two weighted graphs in single closed-loop chain state have common edges;
splitting the weighted graphs of the at least two single closed-loop chain states on the common side according to the minimum weight values corresponding to the weighted graphs of the at least two single closed-loop chain states and the weight values corresponding to the common side, and obtaining the weighted graphs of the at least two independent single closed-loop chain states.
6. A device for processing a weighted directed graph, comprising:
the acquiring module is used for acquiring debt data and debt relations among transaction enterprises;
the weighted graph module is used for establishing a directed weighted graph based on the debt data and the debt relation;
the first processing module is used for optimizing the directed weighted graph to obtain an open-chain directed weighted graph if the directed weighted graph is a single closed-loop chain;
and the second processing module is used for performing traversal processing on the directed weighted graph through a depth-first algorithm to obtain weighted graphs in at least two single closed-loop chain states if the directed weighted graph is a complex closed-loop chain, and optimizing the weighted graph to enable the weighted graph to be an open chain.
7. The apparatus according to claim 6, wherein the directed weighted graph comprises at least three nodes and weights between adjacent nodes.
8. The apparatus for processing a directed weighted graph according to claim 7, wherein the first processing module comprises:
the counteracting unit is used for carrying out mutual counteracting processing based on the minimum weight on the directed weighted graph to obtain an open-chain directed weighted graph;
wherein, the single closed-loop chain is that each node on the directed weighted graph has an incoming edge and an outgoing edge; and the open chain is that the first node only has an outgoing edge and the tail node only has an incoming edge on the directed weighted graph.
9. The apparatus for processing a directed weighted graph according to claim 7, wherein the second processing module comprises:
the access unit is used for starting access from any node A in the directed weighted graph;
the traversal unit is used for sequentially starting from the non-accessed adjacent points starting from the node A and performing depth-first traversal on the directed weighted graph; until the nodes with paths communicated with the directed weighted graph and the node A are accessed, recording the accessed nodes and the weights between adjacent nodes;
the iteration unit is used for starting to access from any node which is not accessed and performing depth-first traversal again until all nodes in the directed weighted graph are accessed if the nodes in the directed weighted graph are not accessed;
and the backtracking unit is used for forming a directed path through iterative backtracking to obtain at least two weighted graphs in a single closed-loop chain state.
10. The apparatus for processing a weighted graph according to claim 9, wherein the backtracking unit is further configured to determine if there is a common edge between weighted graphs of at least two single closed-loop chain states;
splitting the weighted graphs of the at least two single closed-loop chain states on the common side according to the minimum weight values corresponding to the weighted graphs of the at least two single closed-loop chain states and the weight values corresponding to the common side, and obtaining the weighted graphs of the at least two independent single closed-loop chain states.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of processing a directed weighted graph according to any of claims 1 to 5 are implemented by the processor when executing the program.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of processing a directed weighted graph according to any one of claims 1 to 5.
CN202110183545.0A 2021-02-10 2021-02-10 Method and device for processing directed weighted graph Pending CN112925951A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110183545.0A CN112925951A (en) 2021-02-10 2021-02-10 Method and device for processing directed weighted graph

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110183545.0A CN112925951A (en) 2021-02-10 2021-02-10 Method and device for processing directed weighted graph

Publications (1)

Publication Number Publication Date
CN112925951A true CN112925951A (en) 2021-06-08

Family

ID=76171516

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110183545.0A Pending CN112925951A (en) 2021-02-10 2021-02-10 Method and device for processing directed weighted graph

Country Status (1)

Country Link
CN (1) CN112925951A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117648179A (en) * 2023-11-23 2024-03-05 北京菱云科技有限公司 Resource allocation method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117648179A (en) * 2023-11-23 2024-03-05 北京菱云科技有限公司 Resource allocation method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110648054B (en) Task parallel processing method and device for robot flow automation
Tarnawski et al. Efficient algorithms for device placement of dnn graph operators
CN111563820B (en) Intelligent contract parallel execution method and device
CN111813869B (en) Distributed data-based multi-task model training method and system
CN111428217B (en) Fraudulent party identification method, apparatus, electronic device and computer readable storage medium
CN110599166A (en) Method and device for acquiring transaction dependency relationship in block chain
CN112925951A (en) Method and device for processing directed weighted graph
CN117314605B (en) Internet financial business process management method and system
CN114897511A (en) Service flow scheduling processing method and system based on RPA technology
CN111782260A (en) Gray scale distribution method and gray scale distribution device
Oreku et al. State of Tanzania e-readiness and e-commerce: overview
CN103095833B (en) Cloud service system update method and device
CN116339798A (en) Online consumption financial service platform architecture method, storage medium and electronic equipment
CN113031929B (en) Service realization method and device
Liu et al. Digital innovation and transformation to business ecosystems
Barman et al. A study on the impact of 5G on the banking industry: An economic impact perspective
CN109495575B (en) Service configuration method, system and ERP server
US8347203B1 (en) Methods and systems for defining a form navigational structure
CN113467760B (en) Method for creating order model the device storage medium and computer device
CN113938413B (en) Bank card sharing method and device based on block chain
Vallée et al. Optimal time switching from tayloristic to holistic workplace organization
CN114707954B (en) Information management method and system of enterprise intelligent platform
US20120271756A1 (en) Segmentation process and decision matrix
Minz et al. Transformation of the Telecom Industry as a Result of Blockchain Technology in India
McBride Regional: Enabling close-out netting in derivatives transactions and use of international standard contracts in financial markets

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination