# Introduction of a New Index of Field Operations Efficiency
## 2 Materials and Methods
### Generation of Continuous Path
#### 2.2.3 Continuous Path Generation  
With the above-mentioned fixed entities and connectors, a complete path can be generated to cover the entire field according to a specified fieldwork pattern (Figure 7a). Then, the problem of generation a path for field coverage is equivalent to the problem of traversing the undirected, weighted graph (Figure 7b) \(G=(V,\,E)\), where \(V=\{v_{0},v_{1},\ldots,v_{n}\},n\in Z\), is the set of vertices consisting of all ending points of fixed entities and the connectors, with \(v_{0}\) representing the gate, and \(E=\left\{e=\left\{v_{i},v_{j}\right\},\ldots\right\}\), \(v_{i},v_{j}\in V\), is the set of topological edges representing the fixed entities and connectors. Each edge \(e=\left\{v_{i},v_{j}\right\},\ i\
eq j\) is characterized by its type \(g\in\left\{G2H,\,H2H,\,T2H,\,T2H,\,H,\,T\right\}\), and its length that equals to the actual length of the corresponding edge of the fixed entities or connectors. In the undirected graph, all edges can be traversed from both directions in the form of sequence \([s,\,t]\) when \(m=1\) or \([t,\,s]\) when \(m=-1\). Figure 6: An illustrative example of track-to-track connectors (red curved paths) from one track end to all other tracks’ end. Figure 7: The fixed entities and all connectors (**a**), and their conversion to an undirected graph (**b**). The entire continuous path for field coverage consists of four sub-paths, which are: the sub-path that connects the field gate with the outer headland pass, the headland passes traversing path (\(P_{H}\)) that connects all headland passes \(H_{i=\{1,\ldots,h\}}\) as one path that starts from the gate, the fieldwork tracks traversing path (\(P_{T}\)) that connects the ordered tracks and the field exiting path (\(P_{B}\)) for vehicle exiting field from the last track in \(\rho\) when the operation is done. In order to generate these sub-paths, four methods are defined:  
* \(adj(v_{i},m)\) : is a function for headland traversing path \(P_{H}\) generation, which finds all adjacent vertices \(\{v\}\) of \(v_{i}\) that directly link with \(v_{i}\) in the graph based on the given direction \(m\). * \(seq\big{(}v_{i},\ v_{j}\big{)}\) : finds the shortest path with a sequence of vertices from a source vertex \(v_{i}\) to a target vertex \(v_{j}\) on the graph (by implementing the [PERSON]'s algorithm [PERSON] (1986). * \(get(e,m)\) : returns the two vertex ids which correspond to edge \(e\) in sequence \([s,\ t]\) when \(m=1\) or in sequence \([t,s]\) when \(m=-1\). * \(find\big{(}v_{i},v_{j}\big{)}\) : returns the edge \(e\) that links \(v_{i}\) to, \(v_{j}\). * \(\Theta(p)\) : returns the last vertex of path \(p\). The procedures of generation are summarized in Algorithm 1, where the assumed headland traversing direction is clockwise (\(m=1\)). ```
Initialization: Path \(p\) is initialized as set \(p=[v_{0}]\) that starts at gate. \(P_{H}\)path generation: Get all edges with type \(H\), set\({}_{H}=\{e_{i}\}\) where \(e_{i}\)-type \(==H\);  While set\({}_{H}\
eq\varnothing\)  Apply adj\((\Theta(p),1)\rightarrow\{v\}\) to get all adjacent vertices of the last vertex of path \(p\);  If \(\forall x\in\{v\},e=find(\Theta(p),x)\) such that \(e\in set_{H}\) and \(e\)-type \(==H\);  Then add \(e\) to path \(p\ =\ p\cup e\); and remove \(e\) from set\({}_{H}\) : set\({}_{H}=set_{H}\smallsetminus e\);  Else if \(e\)-type \(==H2H\), then add headland connector \(e\) to path \(p\ =\ p\cup e\).